View Full Version : Image Storage Better On Database or File System?
david7777
03-14-2003, 08:03 AM
For a product catalogue site, where images need to be shown in searches and detail pages, is it better to store the images in a database, where i dont have to worry about duplicate names, or on the file system?
If on the file system (probably), how do i eliminate the problem of possible duplicate names of images in a resource friendly way? And are there any things i should consider before designing the upload and image viewing code?
Any tips will be well appreciated!
Spudhead
03-14-2003, 10:24 AM
I wouldn't store BLOBS in a database. I understand that it may impact your database performance, and besides, the filesystem is designed for.. storing files. Keep the file name and other info in the database, but don't keep your images in there.
Regarding duplicate names; use directories to reduce the possibility, and give everything a unique ID number - the database will give it one anyway.
david7777
03-14-2003, 10:35 AM
I never thought of the database id - Thanx! :thumbsup:
Morgoth
03-14-2003, 11:47 AM
Yeah, so to clarify, when you use something like http://ASPUpload.com you name the file to the id that is stored in the database with all the information about the picture.
Yeah.. that seems like the way I would do it.
dominicall
03-21-2003, 07:33 AM
Another technique (the one I use) is to add on to the end of the filename being uploaded the IP address (with dots removed) and the date in format ddmmyyyss...
... I'd be very surprised if you ever ended up with dupe filenames - LOL
dominicall :D
whammy
03-22-2003, 03:02 AM
Yeah I use stuff like that too, Dominicall - i.e.:
filename_20030321_something.ext.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.