• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to display a image file comming as attachment

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Trust God, but always tether your camel... to this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic