Re: DB Image views as ASCII chars
| From: | Nike | Date: | Mon, 05 Jun 2000 11:27:09 +0000 |
| Subject: | Re: DB Image views as ASCII chars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1018@lists.php.net to get a copy of this message | ||
Hello Ayman,
Friday, June 02, 2000, 10:44:25 AM, you wrote:
AM> Hi all,
AM> My Content-Type header is correctly set, however, whenever I try to load the image (i.e. echo
AM> $myimage), it's being shown as ASCII chars. This happens only when I load the image after
AM> executing
AM> previous output command like echo. If I load the image at the begining of my php file, it
AM> would load fine.
AM> (In my case, I need to load the image in the middle of an article)
AM> Anyone knows anything about this?
AM> Thanks,
AM> Ayman
Cause any HHTP output can have only one MIME-type, you must send image from
another script.
ex:
<? //main.php, mime-type is text/html (default)
echo "text only , here is image: <img src=image.php>";
?>
<? //image.php
$jpg=load_from_somewhere();
header("Content-type: image/jpeg");
echo $jpg;
?>
Best regards,
Nike mailto:nike@sendmail.ru