Search code examples
sqldatabasefile-uploadblobflickr

Best way of saving images in the server side


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.


Solution

  • 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.