[GH-ISSUE #1055] $root_path / $root_url for Beginners #676

Closed
opened 2026-03-02 16:00:44 +03:00 by kerem · 4 comments
Owner

Originally created by @MGPhil on GitHub (Jun 11, 2023).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1055

Hello, I checked all issues and tested different combinations but cannot get the open and link button to show the right path...
Everything else works like it should...great tool by the way!

I put tinyfilemanger.php inside a subfolder in my main http directory "webpage" called "filebrowser".
The $_SERVER['DOCUMENT_ROOT'] echos as "/data/web/e00000/html/webpage"
Inside webpage is the folder "filebrowser" with the folders "assets" and "Files" and the tinyfilemanger.php
Inside the folder "Files" are all the files to be shared and uploaded.

User and Admin were set to "/data/web/e00000/html/webpage/filebrowser/Files" under $directories_users.
That works like intended only that folder is visible and uploads go right there.

But when I now click on preview or the link to file button the link looks like:
https://www.webpage.com/filebrowser/data/web/e00000/html/webpage/filebrowser/Files/file.pdf

How can I remove "data/web/e00000/html/webpage/filebrowser/" from the link so that the link looks like:
"https://www.webpage.com/filebrowser/Files/file.pdf"

Thanks a lot

Originally created by @MGPhil on GitHub (Jun 11, 2023). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1055 Hello, I checked all issues and tested different combinations but cannot get the open and link button to show the right path... Everything else works like it should...great tool by the way! I put tinyfilemanger.php inside a subfolder in my main http directory "webpage" called "filebrowser". The $_SERVER['DOCUMENT_ROOT'] echos as "/data/web/e00000/html/webpage" Inside webpage is the folder "filebrowser" with the folders "assets" and "Files" and the tinyfilemanger.php Inside the folder "Files" are all the files to be shared and uploaded. User and Admin were set to "/data/web/e00000/html/webpage/filebrowser/Files" under $directories_users. That works like intended only that folder is visible and uploads go right there. But when I now click on preview or the link to file button the link looks like: https://www.webpage.com/filebrowser/data/web/e00000/html/webpage/filebrowser/Files/file.pdf How can I remove "data/web/e00000/html/webpage/filebrowser/" from the link so that the link looks like: "https://www.webpage.com/filebrowser/Files/file.pdf" Thanks a lot
kerem closed this issue 2026-03-02 16:00:44 +03:00
Author
Owner

@MGPhil commented on GitHub (Jun 28, 2023):

Can nobody help? Still missing a solution, thanks.

<!-- gh-comment-id:1611652308 --> @MGPhil commented on GitHub (Jun 28, 2023): Can nobody help? Still missing a solution, thanks.
Author
Owner

@jolz commented on GitHub (Nov 1, 2023):

Not shure about your setup. You should have something like

# absolute path in local file system
$root_path = $_SERVER['DOCUMENT_ROOT']  . "/filebrowser/Files";

# relative path in Browser URL 
$root_url = "/";

Hope this helps.

<!-- gh-comment-id:1788889508 --> @jolz commented on GitHub (Nov 1, 2023): Not shure about your setup. You should have something like ```php # absolute path in local file system $root_path = $_SERVER['DOCUMENT_ROOT'] . "/filebrowser/Files"; # relative path in Browser URL $root_url = "/"; ``` Hope this helps.
Author
Owner

@MGPhil commented on GitHub (Nov 15, 2023):

Unfortunately not, still "data/web/e00000/html/webpage/filebrowser/" is in the link to each file...

<!-- gh-comment-id:1812872655 --> @MGPhil commented on GitHub (Nov 15, 2023): Unfortunately not, still "data/web/e00000/html/webpage/filebrowser/" is in the link to each file...
Author
Owner

@MGPhil commented on GitHub (Nov 15, 2023):

Ok, now I tried a different $directories_users + $root_path combination and got it to work! Thanks for the help!

<!-- gh-comment-id:1812903936 --> @MGPhil commented on GitHub (Nov 15, 2023): Ok, now I tried a different $directories_users + $root_path combination and got it to work! Thanks for the help!
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#676
No description provided.