Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing $path to a user sub-directory isnt working #25

Open
bchase-woot opened this issue Mar 24, 2020 · 4 comments
Open

changing $path to a user sub-directory isnt working #25

bchase-woot opened this issue Mar 24, 2020 · 4 comments

Comments

@bchase-woot
Copy link

I have tested multiple ways to list the files in a users sub-directory with no change...

I have tried defining the $path variable at the top of the file and commenting out the included $path definition:
define('path', '/home/bob/backups');
as well as
define('$path', '/home/bob/backups');

I have also tried using the $items definitions as well:
$items = scandir( dirname(FILE) . '/home/bob/backups' );

Still no luck. Any assistance would be greatly appreciated

@halgatewood
Copy link
Owner

halgatewood commented Mar 25, 2020

The dirname is relative to where your php file is located. So if your index.php is in the home folder then you would just need to do this:

$items = scandir( dirname(__FILE__) . '/bob/backups' );

@bchase-woot
Copy link
Author

Got it. 2 last questions. Is there anyway to remove the ability to download (already turned off force_download option), but not even allow "right click - save target as". Alternately, is there anyway to force clicking to open in a new tab as opposed to allowing download (such as for log files that simply need reviewing but not downloading)?

@halgatewood
Copy link
Owner

halgatewood commented Apr 7, 2020

For the right-clicking you will need to add that yourself with a script:
https://www.infradox.com/disable-right-clicking-dragging-images/

For opening in a new tab, look at like 184:
$rtn .= "<a href=\"$file\" class=\"$file_ext\"{$download_att}>";

And change it to:
$rtn .= "<a href=\"$file\" class=\"$file_ext\"{$download_att} target=\"_blank\">";

@arifebayraktar
Copy link

Is there a way to list a directory content which out of php folder. I have video files on my attached storage and have to list them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants