Page 1 of 1

How to store images?

Posted: Fri Sep 14, 2007 9:07 am
by kkonline
I have around 500 images each of 70 to 100kb. I want to store it on the webserver.

I can store it by directly uploading it (standard way we do it) or can upload to database as medium blob.
The upside of storing the images in database is that i can easily have number of views and rating using table fields but i have been suggested by many friends that storing on database using blob is not preferable.

Then how do i store the images?

Posted: Fri Sep 14, 2007 9:16 am
by aceconcepts
Just store the filename in a db table and make reference to the image on server via dir path when you want to display it.

Posted: Fri Sep 14, 2007 9:45 am
by VladSun
In my opinion, using DB storage would greatly eliminate the concurrency problems with file names. But I would say that this is its only advantage :)

Posted: Fri Sep 14, 2007 1:23 pm
by aliasxneo
aceconcepts wrote:Just store the filename in a db table and make reference to the image on server via dir path when you want to display it.
I would do this as well. If you're worried about file names just generate a long random string, md5/substr it and attach it to the end of each image. Then just include the random code/file name in the database.

Posted: Fri Sep 14, 2007 5:34 pm
by elinews
Why not just pull the files directly from the directory?