Actually, I would suggest using two scripts. The first takes the id of the row as a GET parameter (say $id) and grabs the image data, sends the header, and echoes the data. The second script outputs a web page with an img tag. As such:

image.php
<?php
$image = get_image_data($_REQUEST['id']);
header('Content-type: image/jpeg');
echo $image;
?>

page.php
<html>
<body>
<h3>Image.jpg</h3>
<img src="image.php?id=2"/>
</body>
</html>

Chris W. Parker wrote:

Ahbaid Gaffoor <mailto:[EMAIL PROTECTED]>
    on Wednesday, December 03, 2003 2:46 PM said:


I have written the first half of my application which stores images in
BLOB fields of an oracle database.

This part of my app. works fine.

I am now trying to download the database stored blob and display it in
my web page.


You might have to write that data to a temporary file and then load that
file in your page. Reason being, in the code sample you gave you are
specifying a header which can't be done halfway down the page unless you
want to get an error. And I think especially you can't change the
Content-type of a page halfway through it and then change it back.

Those are just my thoughts on the subject.


HTH, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to