[GH-ISSUE #1013] Incorrect file url for specified $directories_users array #655

Closed
opened 2026-03-02 16:00:34 +03:00 by kerem · 3 comments
Owner

Originally created by @tonycstech on GitHub (Apr 8, 2023).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1013

$directories_users = array( 'sah' => 'img/SAH', 'sjmc' => 'img/SJMC' );
When user is logged in, user is taken to specified directory as expected.
All files are listed as expected.
File location is showing correct but the URL to file is wrong.
its double adding parts of the path.

Other changes made to the script are:
$root_path = $_SERVER['DOCUMENT_ROOT'].'/img';
$root_url = '/img';

0

.This issue does not effect admin account, only array users.

Originally created by @tonycstech on GitHub (Apr 8, 2023). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1013 `$directories_users = array( 'sah' => 'img/SAH', 'sjmc' => 'img/SJMC' );` When user is logged in, user is taken to specified directory as expected. All files are listed as expected. File location is showing correct but the URL to file is wrong. its double adding parts of the path. Other changes made to the script are: $root_path = $_SERVER['DOCUMENT_ROOT'].'/img'; $root_url = '/img'; ![0](https://user-images.githubusercontent.com/61446662/230695659-9e614e6f-1a7d-4ab2-87f1-91b29469f997.jpg) .This issue does not effect admin account, only array users.
kerem closed this issue 2026-03-02 16:00:35 +03:00
Author
Owner

@tonycstech commented on GitHub (Apr 8, 2023):

File location:
P:/WWW/img/SAH/ENT/Dr. Pai Thyroid Extras.JPG
URL
http://localhost/SAH/ENT/Dr.%20Pai%20Thyroid%20Extras.JPG
Missing "img"

that is why i added
$root_url = '/img';
to fix that. But if i do, array users start to encounter double "img" in the file URL while admin does not.

<!-- gh-comment-id:1500744878 --> @tonycstech commented on GitHub (Apr 8, 2023): File location: P:/WWW/img/SAH/ENT/Dr. Pai Thyroid Extras.JPG URL http://localhost/SAH/ENT/Dr.%20Pai%20Thyroid%20Extras.JPG Missing "img" that is why i added $root_url = '/img'; to fix that. But if i do, array users start to encounter double "img" in the file URL while admin does not.
Author
Owner

@prasathmani commented on GitHub (Apr 8, 2023):

#724,

<!-- gh-comment-id:1500783849 --> @prasathmani commented on GitHub (Apr 8, 2023): #724,
Author
Owner

@tonycstech commented on GitHub (Apr 8, 2023):

The cause for my problem was:
I had admin defined in the
$auth_users = array(
but i gave no directory for admin below
$directories_users = array(

That made the URL's weird depending on what user is logged in and adding parts of missing URL to $root_url = '/img'; was causing the issue.
With $root_url = ''; being blank and admin properly given a directory, it worked.

<!-- gh-comment-id:1500791383 --> @tonycstech commented on GitHub (Apr 8, 2023): The cause for my problem was: I had admin defined in the $auth_users = array( but i gave no directory for admin below $directories_users = array( That made the URL's weird depending on what user is logged in and adding parts of missing URL to $root_url = '/img'; was causing the issue. With $root_url = ''; being blank and admin properly given a directory, it worked.
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#655
No description provided.