Page 2 of 2

Posted: Thu Jul 08, 2004 1:52 pm
by kcomer
Yep put the images in a folder above the web root. Then use some trickery with PHP to get the image from that non web accessible folder and display the image. You can even use some simple checks to try and stop people from leaching images from your site. Also, another good reason for storing a link to the image location and not the image itself is if you have a seperate web server just for images. This is normally only done on high volume sites but it makes it easier to implement if the images aren't in a db.

Posted: Thu Jul 08, 2004 2:31 pm
by EricS
Here's a quick tip I've use when storing images in folder's but storing the image info in a database.

Normally all my images are just numbers.ext EG 1.gif or 2.jpg.

I then have a table in my database which stores the id #, the type (.gif/.jpg/.png/.tiff), and I have a height and width field.

I then simply construct an image field from the database

Code: Select all

$image = '<img src="'.$directory;
$image .= $idNumber.$type.'" height="'.$height.'" width="'.$width.'">';
Bare in mind I that if you store your images outside the web root, you will need to replace the data inside the src="" field with the url to the script that will extract and display the image.

You would then have security measure built into the image display script that authorizes or disapproves the display of the image.

Posted: Mon Nov 07, 2005 9:01 pm
by Photographer
Did anyone ever finish their online gallery/shopping cart for photographers?
I am looking to perchase the software & host the galleries on my website.

Please email me with a demo & price
angela@silk.net

Thank you
-angela

No yet complete.

Posted: Mon Nov 07, 2005 10:14 pm
by EricS
The project I was working on was stopped short because of budgetary reason on the client's side. So as of right now, the photo proofing and shopping application is uncomplete.

Eric Stewart

Posted: Wed Nov 09, 2005 7:04 am
by BZorch
I am doing something similar. I store the path name in the DB and store the folders outside of the www folder.By storing the path name in the DB, I can alter the path depending on if you are requesting thumbnails, med. res, or the high-res images.

So far, I do not regret this route. It seems it would be more difficult to do in a DB and require more hardware overhead. I considered using imagemagick to do the thumbnails and medium res on the fly, but decided it would be too slow as compared to files that are already made.

Unfortunately, to create the three copies of every file is a pain and tough to keep straight.