Jump to content


This topic is now archived and is closed to further replies.


CHMOD Folders

Recommended Posts

Im trying to protect a folder of images so that users cannot simply type in the URL and load the picture.

My site has a login script so that only users who have access can view the pictures. So i want to be able to load these pics onto a webpage for viewing, but i dont want the folder accessible?!

Is this possible, because ive tried quite a few chmod settings, and it seems that to view the image at all needs the Other setting to be 7 (execute). If i set it to anything else, the users cant access the folder dirst (which is what i want), but i cant view them through the webpage either!!

Any suggestions?

Share this post

Link to post
Share on other sites
One way to do it would be to copy the image to a temporary folder when someone requests it. Once the user loads the image into cache (presumably at the end of the page load), you fire off an AJAX call that removes the image from the temp folder. They don't see you do it, and your images are safe. The only problem is that they've cached the image at this point, and anyone with half a brain can rob the file out of the browser cache.

So really, the only way to protect images is to watermark them.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.