View Single Post
  #1 (permalink)  
Old 09-03-2008, 17:01
paulmann paulmann is offline
Junior Member
 
Join Date: Jan 2008
Location: Stoke-on-Trent
Posts: 25
Default Protecting a directory

Not sure how to explain but I'll try my best.

I've got a directory called images which contains various jpg images. These images are not displayed on the website hosting. Instead a php script uses these images when it creates a pdf to download.

If a user knows the folder name and the name of the image they can type in (for example) www.website.co.uk/images/pic1.jpg and it will display on their screen. I don't want this. I've switched of indexing so at least they can't do ...co.uk/images to get a list but I'm still stuck with the problem of them knowing/guessing the name of a jpg file.

How can this be resolved easily? I'm not used to Linux server but I think I can put the images outside of the public_html folder but I'm not sure exactly where it should go instead. Also, how does my php script then call up these images if they are in a protected place?

Say my php calls an image using...

$pdf -> addJPG("images/pic1.jpg");

What pathname do I have to use instead? Or is there an easier way?

As usual - any help gratefully received!
Reply With Quote