• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

storing images in database and retreiving it

 
salamath ahamed
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
how to store an image in database and how to retrieive it ,please help
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two approaches:
1) Store the image file into a BLOB field
2) Keep the image in the filesystem and only store the location into the database
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Opinion. Go with Lasse's 2nd option of storing the image on the file system and storing the location in the database. DB Performance can really decrease when storing Binary data in a table.
However, if you would prefer to store the image itself in the database...

I don't know if this is syntactically correct. But in escense I believe the thoery is correct. I just kind of threw this together.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic