Gossamer Forum
Home : General : Internet Technologies :

IMAP Image Attachment

Quote Reply
IMAP Image Attachment
I'm so proud of myself ... I'm writing a web-based email application for my office and it is coming along wonderfully ... that is until the attachment nightmere.

I can list the attachments included with the email without problem. My trouble is in displaying an attachment. I emailed myself a .gif and when I click on the attachment, would like to display that image on the screen. HELP!!!! Can someone provide me a code snippet or some insight on how to extract the attachment and prepare it for display on the screen?

If the same concept will not work for text, can you provide some enlightenment on that also.

Thanks. You guys are great! (and gals).

Quote Reply
Re: [Lee] IMAP Image Attachment In reply to

You want to make sure you send proper headers to the browser. Specifically, look at the Content-Disposition and Content-Type headers to make sure the browser interprets the image properly.


Gossamer Threads Inc.
Quote Reply
Re: [Alex] IMAP Image Attachment In reply to
I'm about to give up but I thought I'd give this one last try. I have messed with the headers and still can't get this to work. Here's what I am doing:

I receive an email with an image attachment. I extract the file and base64 decode it. In my test letter, after decoding, this is the file of a small GIF I sent myself:

GIF89a1-.ވ1-C@@LIJZWDDvsvstջѰFCDheYVW0,-.*+SPQww­c`ahef=9:xvv""zwxĄ㞝856mkl#MJKZWX# ,Z!HX&/ [.WJ70 ! ?[YY:*­>,T$ X[CY2S͹Y"Xجܢރ5YAݍιBŬ-

Now, I want to display a page that shows the image inline (there will be other wording on the page with the graphic mixed somewhere within the wording). How do I take the above decoded text and turn it into a picture?? HELP!!! :)