[GH-ISSUE #847] image preview does not work when it specifies a different root_path #573

Closed
opened 2026-03-02 15:59:53 +03:00 by kerem · 3 comments
Owner

Originally created by @yigitcevik on GitHub (Aug 30, 2022).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/847

I am giving the path to a different file for the directory path. However, when I do this, previews of the images do not work. The preview works only if $root_path = $_SERVER['DOCUMENT_ROOT'].

$use_auth = false;
$root_path = '/xampp/htdocs/website/images';
$root_url = '';

Image1
Image2

Originally created by @yigitcevik on GitHub (Aug 30, 2022). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/847 I am giving the path to a different file for the directory path. However, when I do this, previews of the images do not work. The preview works only if $root_path = $_SERVER['DOCUMENT_ROOT']. $use_auth = false; $root_path = '/xampp/htdocs/website/images'; $root_url = ''; [Image1](https://raw.githubusercontent.com/yigitcevik/issues/main/preview1.png) [Image2](https://raw.githubusercontent.com/yigitcevik/issues/main/preview2.png)
kerem closed this issue 2026-03-02 15:59:53 +03:00
Author
Owner

@prasathmani commented on GitHub (Aug 31, 2022):

update $root_url accordingly to work. #329

<!-- gh-comment-id:1232493215 --> @prasathmani commented on GitHub (Aug 31, 2022): update `$root_url` accordingly to work. #329
Author
Owner

@yigitcevik commented on GitHub (Aug 31, 2022):

update $root_url accordingly to work. #329

I've tried what you said and researched the problems and tried other solutions, but it's still the same. I tried to enter all kinds of root_url but it didn't work. I uploaded the files to hosting, the new root_path is as follows. What kind of a root_url do I need to write for this?

$use_auth = false;
$root_path = '/home/user/public_html/new/website/images';

<!-- gh-comment-id:1232674983 --> @yigitcevik commented on GitHub (Aug 31, 2022): > update `$root_url` accordingly to work. #329 I've tried what you said and researched the problems and tried other solutions, but it's still the same. I tried to enter all kinds of root_url but it didn't work. I uploaded the files to hosting, the new root_path is as follows. What kind of a root_url do I need to write for this? $use_auth = false; $root_path = '/home/user/public_html/new/website/images';
Author
Owner

@prasathmani commented on GitHub (Sep 1, 2022):

I hope $_SERVER['DOCUMENT_ROOT'] and home/user/public_html are pointing to same path.

$root_path = $_SERVER['DOCUMENT_ROOT'].'/new/website/images';
$root_url = 'new/website/images';

Image preview will not working if $root_path will be outside of server document root

<!-- gh-comment-id:1234098393 --> @prasathmani commented on GitHub (Sep 1, 2022): I hope `$_SERVER['DOCUMENT_ROOT']` and `home/user/public_html` are pointing to same path. ```php $root_path = $_SERVER['DOCUMENT_ROOT'].'/new/website/images'; $root_url = 'new/website/images'; ``` Image preview will not working if `$root_path` will be outside of server document root
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#573
No description provided.