RE: [PHP] How to adress pictures stored outside of the http server root?
| From: | Andrew Chase | Date: | Thu, 21 Mar 2002 22:51:57 +0000 |
| Subject: | RE: [PHP] How to adress pictures stored outside of the http server root? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-89604@lists.php.net to get a copy of this message | ||
If you just want to prevent users from getting a listing of your image
directory, you can do a couple of things:
1) Put an empty 'index.html' (or whatever the server default is) in the
image directory, so anyone trying to browse the directory will get a blank
page.
or
2) (Assuming your server is Apache) Create a '.htaccess' file in the images
directory and add the line
Options -Indexes
Either one ought to be less of a performance hit than doing a readfile() on
each image you want to send to the browser. :)
This article has more stuff on .htaccess:
http://www.codingclick.com/article.php?page=0&aid=3
HTH,
-Andy
> -----Original Message-----
> From: andy [mailto:news.letters@gmx.de]
> hmm sounds logical. The idea was to protect the image directory
> from people
> who would like to download all the image files. Somebody told me to place
> the dir outside the document root. So this seems to be wrong.
>
> What would you suggest to prevent people from downloading all the image
> files?
>
>