Re: display imap inline image?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fredrik Hampus wrote:
> I have rewritten the script and now the output appers in a text form
>
> $testbody = imap_body($mbox, $msgno, "IMAGE/JPEG");
>     $testbody = base64_encode($testbody);
> // header('Content-Type: image/jpeg');
> echo $testbody;
>
>
> This is a sample of the script how can i convert the ouput to an
> image/jpeg?
> The output look like this..
>
> LS0tLS0tPV9QYXJ0XzEyNzk4NjFfNTUz... and so on

That's not a valid JPEG.

It might be a valid JPEG encoded with base64, but browsers aren't gonna
display that correctly.

Or, maybe you should have been using base64_DEcode() to get the JPEG out
of the email, more likely...

> The reason the header line above is comment out is that when enable it
> doesn't
> print out anything but an little frame whith the text image.

That's a broken image icon.  When you finally get it right, it should
start with, errr, yoya or something like that for a valid JPEG.  Only the
o will have an umlat over it, I think.  I know it when I see it :-)

After that, you put the header back in, and it all works, unless it's
Internet Explorer which will ignore the changed header() -- because it
already cached it as non-image data -- so just quit and re-start to see it
as an image.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux