C# – Should I store the images in the database or folders?


Possible Duplicate:
Storing Images in DB – Yea or Nay?


At the moment each Company on my website have 1 picture they can add to their profile.
I save that image into the database….its their Company Logo.

Now i want to allow them to add more pictures. Now i don’t know if i must save it all in the database or save it in folders????

Reason why i think folders will be better is because there are so much nice articles with fancy silver light kinda features that i can use but all of them only cater for images saved in folders.

And since i am not THAT good its hard for me to change the code to look at the database instead of the examples that uses folders for image retrieval.

I would like to add something like this to my website (browsing through the images).
Any code examples for me on how to do this when images are saved in the database? I am using ASP.NET with VB.net.
Click here to view what i am talking about

Any ideas guys?


Best Solution

I've done it both ways recently and personally; I do prefer using the directory method for storing the images while keeping their properties in a DB.

Main reason: I had client to whom I made a website for. On the Webiste; there was a Photo Gallery section that allowed the user to upload new photos (which could be browsed from the public site). Since my client hasn´t thought on optimizing the images before uploading; the *.jpg was over 1mb. I did implement the ability to update the image (once it was saved to the DB) but it had to be done one record at a time.

If this happens while storing the images in a directory, then the files can be saved locally, optimized and put back onto the server.

Here is an example