Two Laptop Bag*
The moose likes Servlets and the fly likes how to display a image file comming as attachment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to display a image file comming as attachment" Watch "how to display a image file comming as attachment" New topic
Author

how to display a image file comming as attachment

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
i am developling a mail client using java mail API. I am having
problem in reading mail having image file as attachment.
I my programme it displays binary sought code.

------------------
cheer up
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
The binary data is what you get. Your should be able to tell what sort of data it is by examining the "mime-type" of the attachment. After that it's up to your code to decide what to do with it.
The answer is not simple, because an email attachment can contain any type of object, not just images. You have to consider what to do if the attachment is a known internally renderable type (say some plain text, or a simple image), a known externally renderable type (say a web page, or some other mime type reprsenting data for an installed application), or a completely unknown or unrenderable type (data for an application you don't have, a movie for which you don't have the codec etc.)
Look at how other mail clients and browsers handle the configuration of this for ideas.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to display a image file comming as attachment