mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2026-04-26 19:05:54 +03:00
[GH-ISSUE #325] Problem with $directories_users and preview #239
Labels
No labels
Feature
Feature
Is It Really an Issue?
Need More Info
Request
Security
bug
duplicate
enhancement
enhancement
help wanted
invalid
pull-request
question
suggestion
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tinyfilemanager#239
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MaartenV87 on GitHub (Mar 19, 2020).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/325
Hi there,
On my website i needed the use the following format to be able to let users access their own personal space.
$directories_users = array(
'user' => '/customers/f/4/f/sbshasselt.be/httpd.www/wiuk/demo/uploads/bowi/',
);
However when the user goes to their space they can't preview the items. The URL is broken.
It creates a location like http://sbshasselt.be/wiuk/customers/f/4/f/sbshasselt.be/httpd.www/wiuk/demo/uploads/bowi/Hasselt.png
and it shoulld be
http://sbshasselt.be/wiuk/demo/uploads/bowi/Hasselt.png
On the website it looks like

Any idea on a fix?
The admin with no restrictions on folders does see the preview.
@prasathmani commented on GitHub (Mar 19, 2020):
@MaartenV87 , try this
@MaartenV87 commented on GitHub (Mar 20, 2020):
Thank you for your answer, but this didn't fixed the problem.
The files are downloadable so their location is correct. It's only the preview that doesn't work.
I think it's something with the FM_ROOT_PATH or $root_path function in combination with my host structure. Maybe if I can hardcode the preview function to not use the FM_ROOT_PATH it will work for me? However I can't find where in the code the preview is build.
@jin146 commented on GitHub (Mar 26, 2020):
Hi, same issue here after a fresh install, even with the admin account (this one doesn't looks like a real admin though, or I missed something).
A user can preview the files until I set his personal directory.
Edit: found a workaround by deleting user specific directories and setting up proper $root_path and $root_url variables (https://github.com/prasathmani/tinyfilemanager/issues/329).
@Xeon33 commented on GitHub (Mar 26, 2020):
Hello,
It looks like when a full path directory is set for a user, the full path and the root path folder is added in the link preview (depends of your web server config).
If you don't want to have the user folder inside tinyfilemanager,
you can try to add a symbolic link (bob) in tinyfilemanager-master folder to your user bob folder and
not use a full path like this:
$directories_users = array(
'bob' => 'bob'
and maybe do this too:
If you remove "$wd.DIRECTORY_SEPARATOR." from this line:
$root_url = $root_url.$wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[FM_SESSION_ID]['logged']];
to looks like this:
$root_url = $root_url.$directories_users[$_SESSION[FM_SESSION_ID]['logged']];
the tinymanager path it's not added anymore, and the link for preview is fine.
That worked for me.
I don't know if doing this could produces some side effects.
Please wait confirmation from Prasathmani
@alaasharkawy60 commented on GitHub (Oct 17, 2022):
hello , I've the same problem
it's working for download not for preview
https://github.com/prasathmani/tinyfilemanager/issues/325#issue-584281851