1

If I want each user in my web app to be able to upload about 6 pictures with a description, what is the best way to store that info in the db?

How would you do it?

Kevin Brown
  • 12,602
  • 34
  • 95
  • 155
  • There's a fairly canonical discussion in the existing http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay question. – John Parker Jan 13 '11 at 19:13

1 Answers1

5

i would save the image files to a location in the file system. then, keep a database table for images that contains id, filepath, description. you may also want to keep other info in the image table as well, for instance, which user the image belongs to, and which is the main image, width, height, etc.

dqhendricks
  • 19,030
  • 11
  • 50
  • 83
  • Certainly have the DB just point to the file. This way it can be stored on the file system, on a remote host or wherever. It'll mean you're much more flexible. – Sid Jan 13 '11 at 23:32