Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: BLOBs
Date: Sep 24 1997 4:45PM
Gayatri Krishnan wrote:
> Can anyone please tell me how to retrieve the images stored as BLOBs in
> the database and display it ina web page??
> I've a few images stored in the DB; I'd like to retrieve them and
> display the images along with some text in the same page.
You can retrieve the images with a normal SELECT (just make sure that
@@textsize is large enough).
However, I don;t think you can display them directly if you
expect to use something like a tag (although I
may very well be mistaken in this!)
The work-around is to select your BLOB, shove it into a temp file, then
set the SRC= when sending the rest of the html to the browser.
Not very elegant, I know, but it should work, and if you have a
reasonable cleanup routine (ie a cron job that removes old temp files)
you shouldn't waste that much space.
Michael Peppler -||- Data Migrations Inc.
email@example.com -||- http://www.mbay.net/~mpeppler