File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to display a image file comming as attachment

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic