0

Possible Duplicate:
Saving images: files or blobs?

im building a site which will have large no of images. so i want to know the best way to save images in the database.

  1. Saving images in database in a BLOB field
  2. Saving images in databases as text
  3. Saving images in separate file and saving the location in the database

What is the best way from above options?what are pros and cons of above options?any suggestions of better way than above?how do Flickr, FB, Google do it?

suggest me some links to read as well.

Community
  • 1
  • 1
  • 1
    asked multiple times before....try searching SO.... – Mitch Wheat Dec 05 '11 at 13:15
  • 1
    See also: http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay http://stackoverflow.com/questions/1047547/correct-way-to-upload-image-to-database http://stackoverflow.com/questions/1071636/storing-images-on-a-database http://stackoverflow.com/questions/1113324/whats-the-best-way-to-send-pictures-to-a-browser-when-they-have-to-be-stored-as etc, etc, ad infinitum. Please search before posting question in future. – Polynomial Dec 05 '11 at 13:19

1 Answers1

2

I have always done it by having the actual image files stored in a folder on the server and then saving the path to the image within the database. This way when I get back a value from the database it is a path which can go straight into the href="" part of the item as the site is also hosted on the same server.

CSharpened
  • 11,674
  • 14
  • 52
  • 86