When storing images to use on a web site there are two directions you can take. You can store the images in a folder or store the images in a table. The decision on which way to use is not always cut and dry but I will provide an overview of the advantages and disadvantages on using both ways.
STORE IN FOLDER
* You can delete and upload without needing any special tools (SQL, etc) * You save and name them and allow Search engines to crawl them. (File names need to be smart) * You can store the images in different folders for different purposes.
* If you have a lot of images it could get overwhelming to perform maintenance on them. (Say you want to remove the images for a particular grouping). * If you ever want to move the images then you have to move each file. * Once you start saving them in a specific location then you cannot easily change the location of the files in the future.
STORE IN DATABASE
*All the images are in one place and you can add attributes as additional fields for classifications. (Tagging, captions, etc) *You do not have to worry about having images that you don’t know about. *Backing Up and testing is easier. Say you are developing a piece of code that requires images. Then if you want to have all the images locally for testing you would just download the .mdf instead of each image. * File folders are better organized. * Allows you to control the displaying of the images. (Set a field to show or disable and mark it accordingly)
* The database could get awfully large * You could not actually go and look at the images like you could if they are in a folder. * SEO is not optimized
In closing let me say that I use a little of both ways. I mostly use a database that holds the name of the file along with attributes, tagging, etc. but actually store the photo in a folder structure. If you need to delete then you can get the files in SQL that you want to delete and then actually go to the folder structure and delete them. If this becomes a problem then you could write a little script to read the database and then delete the images.
Looking for quality web hosting? Look no further than Arvixe Web Hosting!