By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,420 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

File or Folder Permissions - Limit access

P: 145
basicly I have a php script that calls apon files using readfile(), which works as it should, however I want to create a folder (in public_html) where ONLY readfile() can get the files, but the general public/web does not have access too.
I realize I could just put the folder outside public_html, and it would work, however assuming I don't want too, are there some sorta permissions or something i can use?

Summed up: How can I give readfile() access to a file but not the web/public whilst keeping the containing folder in public_html?

thanks. Josh
Oct 10 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 5,058
Seeing as the HTTP server is likely to run your PHP script as the same user that runs the server, using folder permissions to do this may be tricky.

If you are using Apache, you could try using a .htaccess file to *cloak* the files.
(Try Google. There is plenty of info on that online)
Oct 11 '08 #2

P: 145
Ok, thanks for that, answered my question exactly (whether the server and php use same user)
Oct 13 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.