Forum Moderators: phranque

Message Too Old, No Replies

Protect restricted images in images folder...

GD gallery related

         

tomda

7:57 am on Mar 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am using a GD gallery to store images in my images folder. Images are name with their unique ID (gd_ID.jpg) ans some images are restricted to members while others can be seen by all.

The problem I am facing is that guest can easyly guess the picture names and type the following URL (http://www.example.com/images/gd_10.jpg) and see any picture he want (restricted).

What should I do to make sure that restricted picture can not be seen by users going in my images folder? Note that I do not have access to htaccess (rewrite).

Thanks

jorj

9:14 am on Mar 29, 2005 (gmt 0)

10+ Year Member



you should store your files in other folders than the web folder and retrieve them with fpassthru() php function. If you manage to use htaccess & mod_rewrite it would be simple - just catch all /images/* request and read the files from your protected folder. If not, then all your links to images inside your html output should be like
<img src="getimage.php?img=0230">

The point is to have all image requests going through one php file where you can set whatever restrictions you need (like # of downloads/min, or per IP)

Cheers