How to save inline images

Hi,
Using java mail api.
Not able to save those images which are embedded as part of a mail message body.
It has no filename.
How can it be stored and showed as part of web-application whichreplicates the microsoft outlook.

Thank you for your reply.
But I hav few questions here.
How do I translate cid references and save?
I get cid reference name with getHeader("Content-ID");
But this gives me String.Just a name.
How do I save this?
***Is this the way it is or any othe way is there.***
Plz Plz PLz help me.
Its a very big big issue for me.
It would be helpful If anybody can help witha bit of coding example.

Similar Messages

  • How to save inline images and attachments separatley?

    Hi,
    I want to save all inline images into a certain directory and all attachments into another directory.
    I use the following code to do this:
      Multipart multipart = (Multipart) message.getContent();
            for (int x = 0; x < multipart.getCount(); x++) {
                BodyPart bodyPart = multipart.getBodyPart(x);
                String disposition = bodyPart.getDisposition();
                if(disposition != null){
                     log.debug("Disposition: " + disposition);
                     if (disposition.equals(BodyPart.ATTACHMENT)) {
                          log.debug("Mail has attachment: ");
                         DataHandler handler = bodyPart.getDataHandler();
                         log.debug("FILENAME: " + handler.getName());                    
                         saveAttachment(session, bodyPart, emailData);
                     else if(disposition.equals(BodyPart.INLINE)){
                          log.debug("Mail has inline attachment: ");
                         DataHandler handler = bodyPart.getDataHandler();
                         log.debug("Inline FILENAME: " + handler.getName());
                         saveInlineAttachment(session, bodyPart, emailData);
                else {
                     log.debug(bodyPart.getContent());
            }This approach works when the email has inline images only or attachments only.
    It does not work when the email has both inline images and attachments. (Only the attachments are saved).
    Come someone please help me correct my solution so that it can process an email that has both inline images and attachments and save them in different directories.
    Thank you

    Thanks bshannon.
    It took me a while to understand what you meant but I think I finally got it.
    I modified the getText method in order to save the embedded images:
    private Image getImages(Part p, EmailData emailData, String ext) throws MessagingException, IOException {
             if (p.isMimeType("image/*")) {
                InputStream is = p.getInputStream();         
                BufferedImage im = ImageIO.read(is);
                String fileName = "attachments/inline/body " + inlineImageNumber++ + "." + ext;
                File imageFile = new File(fileName);
                ImageIO.write(im,ext,imageFile);
                is.close();
                emailData.getInlineAttachments().add(fileName);
                return null;
            if (p.isMimeType("multipart/related")) {
                Multipart mp = (Multipart)p.getContent();
                Image image = null;
                for (int i = 0; i < mp.getCount(); i++) {
                    Part bp = mp.getBodyPart(i);
                    if (bp.isMimeType("image/jpeg")) {
                        if (image == null){
                            image = getImages(bp, emailData, "jpg");
                        continue;
                    else if (bp.isMimeType("image/gif")) {
                        if (image == null){
                            image = getImages(bp, emailData, "gif");
                        continue;
                    else if (bp.isMimeType("image/bmp")) {
                        if (image == null){
                            image = getImages(bp, emailData, "bmp");
                        continue;
                    else if (bp.isMimeType("image/png")) {
                        if (image == null){
                            image = getImages(bp, emailData, "png");
                        continue;
                return image;
            else if (p.isMimeType("multipart/*")) {
                Multipart mp = (Multipart)p.getContent();
                for (int i = 0; i < mp.getCount(); i++) {
                    Image image = getImages(mp.getBodyPart(i), emailData, "");
                    if (image != null){
                        return image;
            return null;
        }

  • How to save the image in the form?

    As thread, how to save the image into a file from the pdf form - image box?
    I have Adobe Acrobat 9 Pro extended.

    Hi Sandy,
    Sorry for Delay.Could you please provide script code for the Button and in which event we want to add the code
    I want to Save the lot of images in the PDF. For that I kept Image field in the form.Here I am able to upload the images but those are not saved.
    If possible please share the details document.
    Please help me.
    Thanks,
    Ravi.

  • How to save an image as a PICT resource file?

    Can someone tell me how to save an image as a PICT resource file? I'd like to make ikons in Photoshop and save them in this format, but I 'm not finding any leads. Thanks!

    If you have Resorcerer from "ancient times" it of course can handle resource forks since that's was it's goal in life.
    There are lots of icon creation apps these days.  Do a search for "icon" on macupdate.com to see what's available.  For example that search finds:
    iconXprit
    Icon Builder X

  • How to save an image to database and retreive from it.

    how to save an image retreived from an bytearray to database and retreive back the image from database....pls specify the steps and the query.

    You can use the JDBC API for database connectivity and you can use SQL to query the database.
    JDBC tutorial: http://www.google.com/search?q=jdbc+tutorial+site:sun.com
    SQL tutorial: http://www.google.com/search?q=sql+tutorial+site:w3schools.com

  • How to save an image as PDF?

    Hi,
    I need help o how to save an Image as PDF file?? is this possible?

    Under Getting Started in the welcome window click Create PDF
    Open your image
    File>Save As...PDF
    But I am finding that there are limitations on how big the image can be. I am trying to save a 20mb jpeg to pdf in acrobat and having issues. Good luck!

  • How to save an image from canvas to jpeg2000 format?

    good day! i would like some help about jj2000. i wish to save an image from canvas to a jpeg2000 format file. how will i do it using the jj2000? i just need to save it to a file.
    please help!!!
    thank you in advance!
    lrds

    I am not familiar with Jpeg2000, but the easiest way I've found to go from Java to a JPeg file is with Java Adavanced Imaging (JAI) package from Sun. Take a look at it and see if it meets your requirements.

  • How to save iPhoto images on disc

    Trying to save space on My HD, can't figure out how to save an album to a disc

    after having used iPhoto 08 for a long time the link between the program and the source files broke. i have a hard time restoring the library. how can i import ALL images on my harddisc into iphoto? is there a function that scans and finds all images automatically?
    You really would not want to do this - you would have a mess - many duplicates and lots of images that have nothing to do with photos
    Tell us more about your problem - what is happening and how it occurred
    Most likely you have all of your original Photos in the originals folder of your iPhoto library and simply quitting iPhoto, dragging the iPhoto library to the desktop, launching iPhoto and creating a new library and dragging each folder from the originals folder in your iPhoto library on the desktop onto the iPhoto icon in the dock (check to be sure that the iPhoto preference to split items imported from the finder is NOT checked) - this will recreate your events
    If this is not an option their probably is still help
    LN

  • How to save layer image

    Hi, I'm a newbe
    I need to save the image of a layer, but my asset is a psd file, how do I get the image from it?
    Thx

    hi nnzz! welcome to the forum!
    a layer's image pixels are gotten in the same way regardless of the source.
    if your effect is applied to it, you'll have the pixels handed to you from AE automatically.
    in any case you can get the layer's source item and render it through the render suite.
    once you have the pixel datayou can process it and save it in any way you like.

  • PSE 7 Windows 7, 1.5 TB disk, how to save the image

    I got a new PC with a 1.5 TB hard disk, running Windows 7 and PSE 7. With the help of this Forum I managed (changing the scratch disk with  ALT and CONTROL) to start and work with PSE 7.
    However, now I am unable to save the image, again the error message is: Scatch disk full.
    Any ideas how to solve the problem? 

    If you have a spare volume, allocate that as the scratch disk first, followed by the C drive as the second scratch disk.
    Sometimes you run short of RAM if you have lots of open images. Try saving and closing as you work.

  • How to save multiple images from jpeg to psd?

    I'm pretty new at this and have tons of vacation photos. Things I've read have left me terrified of leaving my images in jpeg, but I don't know how to save them all to .psd (and is that really the format I want to use?). I tried, and suddenly I'm out of space on my harddrive, so I think I've made copies of copies and have way more saved than I need. Any advice is appreciated - thanks.

    <[email protected]> wrote<br />> ...Things I've read have left me terrified of leaving my images in jpeg...<br /><br />Andrea,<br /><br />If the JPEG files are straight out of your camera, there is no harm in <br />"leaving" them as-is...  they don't degrade from just sitting there.<br /><br />The possible degradation of JPEG files comes from saving as a JPEG - <br />typically after you have done an edit to the image.<br /><br />One good way to approach the issue:  when you open an image for editing, <br />before you do anything, click the menu File > Save As...  and then choose <br />the PSD file type.  This will make a copy for you to work with, which will <br />NOT degrade as you save, re-edit, re-save, etc.  After you're finished <br />working it over, if you need a JPEG copy, use the File > Save As...  and <br />select JPEG to make an edited copy in the smaller file format.  (File > Save <br />For Web is also useful for this - it allows you to set your quality and size <br />parameters on-the-fly as you save)<br /><br />HTH,<br /><br />Byron

  • How to save greyscale image as jpeg?

    Anyone know how to save a greyscale image as a jpeg in labview?

    Hi Jonathan,
    If I understand you correctly, you had a greyscaled image, which you applied color to and now want to save this new image.  Before I jump into possibly solutions, I have a question for you. 
    Are you using any IMAQ, Motion, or Vision VIs?  If not, try using the Picture Control VIs - specifically, the "Write JPEG File.VI"
    If that won't work, please post a small piece of code illustrating the issue.
    Thanks!
    Janell Rodriguez | Applications Engineer | National Instruments

  • How to save an image on iOS Safari direct to iCloud Drive

    I'm currently browsing Safari on my iPhone and found a picture I'd like to save.
    There's no option for me to save it to a user-created folder in iCloud Drive. Why?
    I basicly have no way to browse, create, move, copy and share files with others
    on iCloud Drive.
    My opinion is iCloud Drive is no Dropbox killer, AT ALL!

    I don't know of any way to save an image from IOS Safari "direct" to iCloud, but FWIW I don't know how to do that "direct" to Dropbox either.
    However, there are lots of ways to get a Safari image to iCloud albeit not quite "directly."
    1.  Send a link of the image from your IOS device to a Mac.   Open the link on the Mac and copy the image to your desktop.  Open iCloud and drag and drop the image there.
    2.  Copy the image from IOS Safari, open an email to yourself, and paste the image.  Open the email on your Mac and proceed as in #1.
    3.  Copy the image in IOS Safari, open a Pages document, and paste the image there.  It will automatically be saved to iCloud.
    4.  Petition Apple to implement the "direct" transfer.
    And there may well be other ways too - this can't exhaust the possibilities.
    Hope this helps.

  • How to save an image in png format?

    I have modified an image with J2ME and stored this into a byte array, now how can I save this byte array like a png Image??? or anyone format. Class Image have not some method for this task.

    you can use rms to save your image. Try to learn it on http://java.sun.com/javame/reference/apis/jsr037/javax/microedition/rms/RecordStore.html

  • How to save an image into the RTF Viewer

    RTF Viewer.
    The current problem that I have with the RTFViewer is that the RTFEditor allows for images to be inserted but on save the images get lost and no information on the images are saved.

    daregazi wrote:
    I have posted my problem before, nobody replied so I ask again if anybody has any solution??
    I want to save an image, which I created before from a physical file and did some bit-level manipulation, into the same or a new (doesn't matter) physical file (say in png format). But I do not know how to do it. I have tried the FileConnection API and OutputStream and then the method write() to write the byte array, rather this does not solve my problem. I need something like corresponding to J2SE ImageIO.write(image,null) function. Any Idea??
    please.....I don't think it's possible in a midlet. You'll have to save the data as a byte[] to a RecordStore and then convert it back again if you want the midlet to redisplay it.

Maybe you are looking for

  • Problems Printing to Shared Windows Printer

    After upgrading to Leopard (Mac OS X 10.5), I can no longer print to my HP DeskJet 5150 printer from my Apple MacBookPro laptop. This Deskjet printer is NOT directly connected to the laptop. Instead, it's directly connected to my Windows PC (via USB

  • Some web pages will not scroll after update7

    Recently was FORCED to update my Ipad if I wanted to use podcasts. Now, some webpages will not scroll down and lockup. (safari) Never had this problem before update.  So I purchased another browser, (atomic) and it does the same thing. (and I dreaded

  • Import/Export of Personalization

    Hi All, We have three instances - CRP1, CRP2 & UAT. We had made personalizations in  CRP1 and migrated them to CRP2 using Import/Export functionality from Functional Administrator responsibility.Again, few more personalizations were made in CRP2. Now

  • Why do my AppSettings have the icon without setting it?

    I tried to study setting some preferences in Settings. I add a setting bundle to my project. And I created a textField item to add to the Settings. Fotunately, it did work. My question is the icon when I tried to run my Apps. There has a Yellow icon

  • WMI Health Check script

    Hi Experts I am looking client WMI health check. When I run the script it should check local WMI and give result in log file. if any issue it should reslove. Thanks