Click to See Complete Forum and Search --> : Displaying images from database


Vic
09-25-2005, 12:40 AM
I am trying to show an image on my website, but I need to draw the image from a database rather than point to an image file on a disk. Any thoughts on how this may be achieved?

Thanks in advance...

Richard Conyard
09-26-2005, 05:47 AM
Store the binary data for the image in a blob - write an asp page that returns the content type of the image and binarywrites the blob back to the browser.

Vic
09-26-2005, 08:45 PM
Thanks. Any thoughts on where to begin? I gather this may be somewhat complex, but a starting point (particularly on how to pass content of a blob back to the browser) would be great...

Richard Conyard
09-27-2005, 06:30 AM
Off the top of my head something like:

response.ContentType = "image/jpeg"
response.BinaryWrite( rsData( "BlobField" ) )