Sorry running from memory here. You need to set your output headers to display a jpg not text. So you need something like:

header("Content-type: image/jpg");

This will display the image on its own, if you need to embed the image in a web page you need a little more trickery. I'll try to look it up for you. But this should at least get you going on testing getting your image from the database.


graeme

MikeA wrote:

I am trying to output a JPG image to the browser without creating a file. I 
have tried several
things but nothing seems to work. I sure could use a whole lot of help right 
now!  LOL  Going crazy
trying to figure this out.  But I know there are PHP gurus out there that will 
have the answer in 2
seconds.  Hopefully I'll be at that level someday too!

The image comes from a MySQL Blob.  The closest I get is a string of garbage on 
the browser display.
I cannot get it to display a pictures.

Suggestions, comments, help, almost anything is appreciated. PLEASE help me! 
Project due in a week.

Thanks in advance.

Mike


if( mysql_num_rows($result) == 1 ) { //header('Content-type: image/*'); $fileContent = mysql_result($result,0); //,$blobfield); echo $fileContent;

   //$theimage = imagecreatefromstring ($fileContent);

   //echo imagejpeg ( $theimage);




-- Experience is a good teacher, but she sends in terrific bills.

Minna Antrim

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



Reply via email to