[GH-ISSUE #281] problem uploading files #203

Closed
opened 2026-03-02 15:56:48 +03:00 by kerem · 7 comments
Owner

Originally created by @qwwwest on GitHub (Jan 10, 2020).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/281

tinyfilemanager uploading works well except when using it embedded...
define('FM_EMBED', true);
then the uploading fails while saying everything was fine...

Originally created by @qwwwest on GitHub (Jan 10, 2020). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/281 tinyfilemanager uploading works well except when using it embedded... `define('FM_EMBED', true);` then the uploading fails while saying everything was fine...
kerem 2026-03-02 15:56:48 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@prasathmani commented on GitHub (Jan 11, 2020):

#233
check folder has write permission

<!-- gh-comment-id:573264885 --> @prasathmani commented on GitHub (Jan 11, 2020): #233 check folder has write permission
Author
Owner

@qwwwest commented on GitHub (Jan 11, 2020):

I'm on Windows.
If I use TinyFileManager without embedding it I can upload in that folder. If I embed TinyFileManager It does not work anymore...

<!-- gh-comment-id:573296407 --> @qwwwest commented on GitHub (Jan 11, 2020): I'm on Windows. If I use TinyFileManager without embedding it I can upload in that folder. If I embed TinyFileManager It does not work anymore...
Author
Owner

@qwwwest commented on GitHub (Jan 13, 2020):

@prasathmani !
I have found out why uploading fail in my case...
i use a .htaccess file to redirect virtual URL to my index.php.
My index.php display TinyFileManager for the URL 'admin/fm'.
now... the generated html by TinyFileManager point to my index.php instead of 'admin/fm'
so my index.html fail to load TinyFileManager...
I managed to solve this problem by changing TinyFileManager @ line 1083 :

<?php echo htmlspecialchars($_SERVER["PHP_SELF"]) . '?p=' . fm_enc(FM_PATH) ?>

by

<? echo htmlspecialchars(FM_SELF_URL) . '?p=' . fm_enc(FM_PATH) ?>

and i use :
define('FM_SELF_URL', dirname($_SERVER['PHP_SELF']) . '/admin/fm');
Is it a bug or a feature ?
Thanks for this great program :)

<!-- gh-comment-id:573586412 --> @qwwwest commented on GitHub (Jan 13, 2020): @prasathmani ! I have found out why uploading fail in my case... i use a .htaccess file to redirect virtual URL to my index.php. My index.php display TinyFileManager for the URL 'admin/fm'. now... the generated html by TinyFileManager point to my index.php instead of 'admin/fm' so my index.html fail to load TinyFileManager... I managed to solve this problem by changing TinyFileManager @ line 1083 : ``` <?php echo htmlspecialchars($_SERVER["PHP_SELF"]) . '?p=' . fm_enc(FM_PATH) ?> ``` by ``` <? echo htmlspecialchars(FM_SELF_URL) . '?p=' . fm_enc(FM_PATH) ?> ``` and i use : `define('FM_SELF_URL', dirname($_SERVER['PHP_SELF']) . '/admin/fm'); ` Is it a bug or a feature ? Thanks for this great program :)
Author
Owner

@prasathmani commented on GitHub (Jan 13, 2020):

@deivh great!
you can manage the path and URL by configuration,

$root_path = $_SERVER['DOCUMENT_ROOT'].'/admin/fm';
$root_url = '/admin/fm';
<!-- gh-comment-id:573594954 --> @prasathmani commented on GitHub (Jan 13, 2020): @deivh great! you can manage the path and URL by configuration, ```php $root_path = $_SERVER['DOCUMENT_ROOT'].'/admin/fm'; $root_url = '/admin/fm'; ```
Author
Owner

@qwwwest commented on GitHub (Jan 13, 2020):

@prasathmani
I use TinyFileManager for my CMS to handle media files...
'/admin/fm' is not a real folder just a URL
if i try to configure this way i get :
Root path "C:/laragon/www/mempad/admin/fm" not found!

<!-- gh-comment-id:573597974 --> @qwwwest commented on GitHub (Jan 13, 2020): @prasathmani I use TinyFileManager for my CMS to handle media files... '/admin/fm' is not a real folder just a URL if i try to configure this way i get : Root path "C:/laragon/www/mempad/admin/fm" not found!
Author
Owner

@prasathmani commented on GitHub (Jan 13, 2020):

okay, if you want to change the only URL use $root_url. or your approach FM_SELF_URL also fine

<!-- gh-comment-id:573599856 --> @prasathmani commented on GitHub (Jan 13, 2020): okay, if you want to change the only URL use `$root_url`. or your approach `FM_SELF_URL` also fine
Author
Owner

@qwwwest commented on GitHub (Jan 13, 2020):

if I change only $root_url then it generates URL like this :
http://localhost/mempad/admin/fm/dev.jpg (which does not work)
my real "root folder" for uploading files is '/var/www/mempad/media/'
("http://localhost/mempad/media")
I think there is a problem using TinyFileManager with htaccess if we dont use my workaround
@ line 1083

<!-- gh-comment-id:573608169 --> @qwwwest commented on GitHub (Jan 13, 2020): if I change only` $root_url` then it generates URL like this : http://localhost/mempad/admin/fm/dev.jpg (which does not work) my real "root folder" for uploading files is '/var/www/mempad/media/' ("http://localhost/mempad/media") I think there is a problem using TinyFileManager with htaccess if we dont use my workaround @ line 1083
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#203
No description provided.