Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Upload Picture - Path or Binary?

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I was thinking which is the best solution for me. I need to include file upload capabilities to my web app. But before I struggle to learn any other API's I'd like to be sure which method in my database should I use. Should I make a folder where I upload image and store the address of the folder to my database(String or varchar)? Or should I store it in my database as binary data? I need only to store pictures... Thanks!
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is more a decison based on your application needs.
but as far as i can tell It will be better to store images into Database , it will help data integrity .

for example deleting the record which would provide information about the image will delete the image too.
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Data integerity is one reason to store it in the DB; another way of looking at that is that you've only got one thing to back up.

One of the negatives is that image data is often big, and database storage can be substantially more expensive than regular disk storage (some Enterprise DBs use high-speed RAID arrays with fibre-channel controllers, for example).

So it depends a lot on the target database and the number of images. If I were to be writing a commercial image archiving product, I would try to support both ways.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic