Attachment Encoding in Entourage???

I am having a problem with attachements using Entourage. I attach JPEG files, they are encoded and sent and everything looks fine. I can go to my sent mail and open them etc. However when they are sent to Windows XP clients they appear as hexadecimal mambo jumbo.
I have tried the various encoding formats with no luck.
I have also tested the same files via Mail and they work fine.
Any suggestions would be much appreciated.
Cheers
Daniel

Using HTML for message composition can sometimes be problematic for image type attachments. This might be caused by the sending and transfer process from and/or between the SMTP server used by the account and the recipient's incoming mail server.
I know Entourage has a Plain Text option but does it also include a RTF option for message compostion?
If so, try either one instead of HTML formatting which is tops on my list of the worst things Microsoft wrought upon the internet for email messages.
If the same occurs using RTF or Plain Text, it is either a problem with Entourage, the SMTP server used by the account or the recipient's incoming mail sever.

Similar Messages

  • I received a .pdf document as an attachment to an Entourage Email. It refuse to print on my HP4050N printer which is otherwise performing as advertised. Printing fron the desktop, Adobe 9.4.4 nor Preview won't work. I have a PowerPC G5, OS 10.4.11.

    I received a .pdf document as an attachment to an Entourage Email. It refuse to print on my HP4050N printer which is otherwise performing as advertised. Printing fron the desktop, Adobe 9.4.4 nor Preview won't work. I have a PowerPC G5, OS 10.4.11.

    I think the file has somehow been corrupted. Can you have the person that sent it to you send another copy?
     Cheers, Tom

  • File attachment encoding problem

    Guys,
    I spend to much time trying to get trough this.
    I use xsl mapping for preparing to send mail by mail adapter.
    File is encoded ANSI (not UTF-8) when i zip it to import it as archive for using this in maaping.
    It's realy simple XSL.
    It's adding IDOC ORDERS04 as xml attachment.
    This is the XSL file:
    "<?xml version="1.0" encoding="iso-8859-2"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" version="1.0" exclude-result-prefixes="rfc">
           <xsl:output method="xml" encoding="iso-8859-2" indent="yes"/>
           <xsl:template match="*">
                   <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
                           <Subject>Order no. <xsl:value-of select="//BELNR" /></Subject>
                           <From>testattest.pl</From>
                           <To>
                           <xsl:value-of select="//RCVLAD" />
                           </To>
                           <Content_Type>multipart/mixed; boundary="--AaZz"</Content_Type>
                           <Content>
    AaZz
    Content-Type: text/plain; charset=iso-8859-2
    Content-Disposition: inline
    <xsl:text>Order file.
    AaZz
    Content-Type: text/xml; name=order.xml
    Content-Disposition: attachment; filename=Order no. <xsl:value-of select="//BELNR" />.xml
    <xsl:text>
    </xsl:text>
          &lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-2&quot; ?&gt;
          &lt;?xml-stylesheet href=&quot;idoc_orders04.xsl&quot; type=&quot;text/xsl&quot;?&gt;
    <ORDERS04>
    <xsl:text>
    </xsl:text>
    <IDOC BEGIN='1'>
    <xsl:text>
    </xsl:text>
    <xsl:copy-of select="//EDI_DC40"/>
    <xsl:text>
    </xsl:text>
    <xsl:for-each select="//E1EDK01">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK14">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK03">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK04">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK05">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDKA1">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK02">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK17">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK18">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK35">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK36">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDKT1">
    <E1EDKT1>
    <xsl:copy-of select="TDID"/>
    <xsl:copy-of select="TSSPRAS"/>
    <xsl:copy-of select="TSSPRAS_ISO"/>
    <xsl:copy-of select="TDOBJECT"/>
    <xsl:copy-of select="TDOBNAME"/>
    <xsl:for-each select="E1EDKT2">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </E1EDKT1>
    </xsl:for-each>
    <xsl:for-each select="//E1EDP01">
    <E1EDP01>
    <xsl:copy-of select="POSEX"/>
    <xsl:copy-of select="ACTION"/>
    <xsl:copy-of select="PSTYP"/>
    <xsl:copy-of select="KZABS"/>
    <xsl:copy-of select="MENGE"/>
    <xsl:copy-of select="MENEE"/>
    <xsl:copy-of select="BMNG2"/>
    <xsl:copy-of select="PMENE"/>
    <xsl:copy-of select="ABFTZ"/>
    <xsl:copy-of select="VPREI"/>
    <xsl:copy-of select="PEINH"/>
    <xsl:copy-of select="NETWR"/>
    <xsl:copy-of select="ANETW"/>
    <xsl:copy-of select="SKFBP"/>
    <xsl:copy-of select="NTGEW"/>
    <xsl:copy-of select="GEWEI"/>
    <xsl:copy-of select="EINKZ"/>
    <xsl:copy-of select="CURCY"/>
    <xsl:copy-of select="PREIS"/>
    <xsl:copy-of select="MATKL"/>
    <xsl:copy-of select="UEPOS"/>
    <xsl:copy-of select="GRKOR"/>
    <xsl:copy-of select="EVERS"/>
    <xsl:copy-of select="BPUMN"/>
    <xsl:copy-of select="BPUMZ"/>
    <xsl:copy-of select="ABGRU"/>
    <xsl:copy-of select="ABGRT"/>
    <xsl:copy-of select="ANTLF"/>
    <xsl:copy-of select="FIXMG"/>
    <xsl:copy-of select="KZAZU"/>
    <xsl:copy-of select="BRGEW"/>
    <xsl:copy-of select="PSTYV"/>
    <xsl:copy-of select="EMPST"/>
    <xsl:copy-of select="ABTNR"/>
    <xsl:copy-of select="ABRVW"/>
    <xsl:copy-of select="WERKS"/>
    <xsl:copy-of select="LPRIO"/>
    <xsl:copy-of select="LPRIO_BEZ"/>
    <xsl:copy-of select="ROUTE"/>
    <xsl:copy-of select="ROUTE_BEZ"/>
    <xsl:copy-of select="LGORT"/>
    <xsl:copy-of select="VSTEL"/>
    <xsl:copy-of select="DELCO"/>
    <xsl:copy-of select="MATNR"/>
    <xsl:copy-of select="VALTG"/>
    <xsl:copy-of select="HIPOS"/>
    <xsl:copy-of select="HIEVW"/>
    <xsl:copy-of select="POSGUID"/>
    <xsl:text>
    </xsl:text>
    <xsl:for-each select="E1EDP02">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1CUREF">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1ADDI1">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP03">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP04">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP05">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP20">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDPA1">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP19">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP17">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP18">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP35">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDPT1">
    <E1EDPT1>
    <xsl:copy-of select="TDID"/>
    <xsl:copy-of select="TSSPRAS"/>
    <xsl:copy-of select="TSSPRAS_ISO"/>
    <xsl:for-each select="E1EDPT2">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </E1EDPT1>
    </xsl:for-each>
    <xsl:for-each select="E1EDC01">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </E1EDP01>
    </xsl:for-each>
    <xsl:for-each select="//E1CUCFG">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDL37">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDS01">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </IDOC>
    <xsl:text>
    </xsl:text>
    </ORDERS04>
    </Content>
                   </ns:Mail>
           </xsl:template>
    </xsl:stylesheet>"
    When i import it i can view this file when i open imported archive.
    There i can see that this is iso-8859-2 encoded file.
    When i recive mail and when i save the file it's UTF-8 encoded.
    I'm not talking about declaration in XML file etc. There everything is OK.
    Just when i open file lets say in Edit++ and check code page for file it's UTF-8.
    I need iso-8859-2 code page for the file.
    How can i convert it/do this?
    I used TextCodepageConversionBean but this is not working for that scenerio.
    In file adapter you can choose it.
    Thanks for help,
    Olek

    Are you sure, that your xslt is really used?
    In your XSLT I see:
    <Content>
    ----AaZz
    Content-Type: text/plain; charset=iso-8859-2
    Content-Disposition: inline
    The same place in the SXMB_MONI there is:
    <Content>
    ----AaZz
    Content-Type: text/plain; charset=UTF-8
    Content-Disposition: inline
    I assume that you changed the XSLT meanwhile, but the changes are not active.

  • Apple mail attachment encoding problem

    I'm having the problem lately that either attachments aren't being decoded properly and the source is displayed in the email or that the entire email is being displayed like this:
    --Apple-Mail-7--951337123
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
    charset=ISO-8859-1;
    delsp=yes;
    format=flowed
    FYI
    --Apple-Mail-7--951337123
    Content-Transfer-Encoding: base64
    Content-Type: application/octet-stream;
    x-mac-type=584C5338;
    x-unix-mode=0744;
    x-mac-creator=5843454C;
    name="report.xls"
    Content-Disposition: attachment;
    filename=report.xls
    0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAA
    EAAAQAAAAAEAAAD+////AAAAAAAAAAD/////////////////////////////////////////////
    We have the same problems with UTF-8 encoded mails. If I select the Inbox, then select Mailbox -> Rebuild it fixes it, but I need a better solution to fix this. Several others are having the same problem and it seems to be happenning intermittently.
    Anyone have any suggestions?
    macbook pro 1.86Ghz   Mac OS X (10.4.5)  

    duren wrote:
    Some of my clients cannot open these inline images.
    This clients use presumably Outlook 2007. It's not your or Apple Mail's fault, it's a known bug in Outlook 2007 and there is also a Microsoft Help and Support Article from April 2007 about that issue.
    Here -> http://support.microsoft.com/kb/917120
    A workaround is also described there.
    A simple ad hoc solution is to ZIP the pictures before attaching to mail
    Lupunus

  • Cfmail/cfmailparam attachment encoding

    When a text file is attached to an email, cfmail attempts to determin the mime type of the file and encodes it. This alters the content of the file somewhat. As best I can tell it is at least inserting line breaks. 
    Is there a way to attach files that are not encoded or altered in any way?
    Thanks for any help. 

    This will happen at the recipient's end depending on the mail
    server/client they use ... you could send a pdf from your desktop
    to the same recipient and it will happen with that too.
    It could be a security reflex that it changes the file to a
    non-binary format if it is not trusted or seems to be coming from a
    questionable source.
    A number of the government servers seem to do that - no idea
    why, but renaming the file at the recipient's end generally allows
    it to open properly.
    Nothing you do in your code is going to change that.
    *** If you are storing the file on the server, you may want
    to include a line in the message that gives them a URL if the
    attachment can not be viewed properly.

  • Email attachment content corrupted, Encoding Issue

    Hi all, I have problem with corrupted email attachments.
    I write JSP codes to send the html file I have created as an ATTACHMENT by using codes:
    messageBodyPart = new MimeBodyPart();
    FileDataSource fds = new FileDataSource(tempAttachment);
    messageBodyPart.setDataHandler(new DataHandler(fds));
    messageBodyPart.setFileName(filename);
    multipart.addBodyPart(messageBodyPart);
    I can successfully send out an email with attachment, however, the attachment when received by Outlook Express, Gmail, Thunderbird are fine without any corruption, but it was corrupted when received with my Outlook 2000. It is totally corrupted and cannot be converted even I change any encodings to view it. Please find below the corrupted text for your reference:
    [email protected]& @{83;g@Z8i 1MGO 6G4B 1MGO@G ?)G` 0hH94c4g@Z0! ?9>`GR 6' A$H.GQ <:8m 9W ?y5eF\=: 9xH#8& >K7AAV=C1b 9Y6x4O4Y.
    I found many resources to help people to do encoding for the mail subject and attachment file name, but coundn't find any for the encoding of the attachment content, many authors even suggest that the email client will do the job for attachment encoding conversion. But, Outlook 2000 sucks, I need to do it explicitly in the coding, would anyone of you help me?
    Thanks a lot for your help and this is urgent, your help is highly appreciated.

    Hey, where are the experts?Maybe the JavaMail experts view the JavaMail forum!
    >
    OMG, people in this forum only know how to get stuff
    from the others and never thinking of sharing your
    knowledge with the others?This is just stupid! If nobody is "sharing your knowledge" then how can others "get stuff"?
    >
    Or there are no experts in this forum???Plenty! Many have written well thought of books on various Java topics.
    I am not an expert in JavaMail but I use JavaMail and have sent JavaMail with attachments to Outlook 2000 but I have never seen your problem. Don't you think it significant that all woks OK except on Outlook 2000! Maybe printing the raw email will help you decide what is wrong.
    P.S. Consider moving the code that sends the email out fo the JSP to a class that can be tested outside the web server. Then if you have a problem you can post more than just a fragment.

  • Opening pdf attachments in Entourage

    How can I set the opening of pdf file attachments in Entourage to Acrobat instead of Preview?

    Are you including the .jpg file extension with all attached files and what are you using for the attachment encoding selection available with Entourage?
    At the menu bar go to Entourage > Preferences > Compose.
    Under Attachments at Encode for:, you should use Any Computer (AppleDouble) or Windows (MIME/Base 64).

  • Opening photo attachments in entourage

    I usually revise photos in Photoshop and save them as JPEGs. Some people who receive these photos can't open them. I have all the photos on this computer set to open via Preview as opposed to Photoshop. Most of the recipients with problems are probably using Windows. But shouldn't JPEGs open on any computer with a viewer? When I send the photos via an AOL mail account they seem to open fine. Why the problem with Entourage mails?

    Are you including the .jpg file extension with all attached files and what are you using for the attachment encoding selection available with Entourage?
    At the menu bar go to Entourage > Preferences > Compose.
    Under Attachments at Encode for:, you should use Any Computer (AppleDouble) or Windows (MIME/Base 64).

  • File attachment issue in MimeMessage [Mail API]

    Hi,
    I tried to attach PDF and XML file in MIME Message of MAIL API. I want attach encoded PDF and XML file with gzip format.
    I’m able to attached both the files but its not attached properly and when i tried to retrieved back from MIME Message, I’m getting error.
    Error is
    java.util.zip.ZipException: oversubscribed literal/length tree
         at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
         at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at com.asite.supernova.test.CreateReadMimeMessage.ReadMail1(CreateReadMimeMessage.java:145)
         at com.asite.supernova.test.CreateReadMimeMessage.main(CreateReadMimeMessage.java:48)
    Here my code
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.Reader;
    import java.io.StringWriter;
    import java.io.Writer;
    import java.util.Date;
    import java.util.Enumeration;
    import java.util.Properties;
    import java.util.zip.CRC32;
    import java.util.zip.Deflater;
    import java.util.zip.GZIPInputStream;
    import java.util.zip.GZIPOutputStream;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import javax.activation.DataHandler;
    import javax.activation.DataSource;
    import javax.mail.BodyPart;
    import javax.mail.Header;
    import javax.mail.Message;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    import org.apache.commons.codec.binary.Base64;
    import com.sun.istack.internal.ByteArrayDataSource;
    public class CreateReadMimeMessage {
         public static void main(String[] args) {
              CreateMail();
              ReadMail1();
         public static void CreateMail(){
              try{
                   Properties properties = System.getProperties();
                 Session session = Session.getDefaultInstance(properties);
                 Message msg = new MimeMessage(session);
                 msg.setSentDate(new Date());            
                 Multipart multipart = new MimeMultipart();
                 BodyPart part1 = new MimeBodyPart();           
                 part1.setFileName("test.pdf");                               
                 part1.setHeader("Content-Type", "application/pdf");
                 part1.setHeader("Content-Encoding", "gzip");
                 part1.setHeader("Content-ID", "PDF");
                 //1
                 compressFile("test.pdf","testpdf.gzip");
                 String encodedData = new String(getBytesFromFile(new File("testpdf.gzip")));
                 //1
                 DataSource ds = new ByteArrayDataSource(encodedData.getBytes(), "application/pdf");            
                 DataHandler dh = new DataHandler(ds);
                 part1.setDataHandler(dh);
                 //part1.setText("This is only text data");
                 BodyPart part2 = new MimeBodyPart();
                 part2.setFileName("test.xml");
                 part2.setHeader("Content-Type", "application/xml;");
                 part2.setHeader("Content-Encoding", "gzip");
                 part2.setHeader("Content-ID", "XML");
                 part2.setHeader("Content-Transfer-Encoding", "base64");
                 //1
                 compressFile("test.xml","textxml.gzip");
                 String dataXML = new String(getBytesFromFile(new File("textxml.gzip")));
                 DataSource ds1 = new ByteArrayDataSource(dataXML.getBytes(), "application/xml");
                 DataHandler dh1 = new DataHandler(ds1);
                 part2.setDataHandler(dh1);            
                 multipart.addBodyPart(part1);
                 multipart.addBodyPart(part2);
                 msg.setContent(multipart);
                 msg.writeTo(new FileOutputStream(new File("MIMEMessage.xml")));
              }catch (Exception e) {
                   // TODO: handle exception
                   e.printStackTrace();
         public static void ReadMail1(){
              try{
                   Properties properties = System.getProperties();
                 Session session = Session.getDefaultInstance(properties);
                 InputStream inFile = new FileInputStream(new File("MIMEMessage.xml"));
                 Message msg = new MimeMessage(session,inFile);     
                Multipart multipart = (Multipart) msg.getContent();
                for (int i = 0; i < multipart.getCount(); i++) {              
                    BodyPart bodyPart = multipart.getBodyPart(i);
                    Enumeration enumHeader = bodyPart.getAllHeaders();
                    String fileExt="";
                    while(enumHeader.hasMoreElements()){
                         Header header = (Header) enumHeader.nextElement();
                         System.out.println(header.getName() + ":" + header.getValue());
                         if(header.getName().equalsIgnoreCase("Content-ID")){
                              if(header.getValue().equalsIgnoreCase("pdf")){
                                   fileExt=".pdf";
                              }else if(header.getValue().equalsIgnoreCase("xml")){
                                   fileExt=".xml";
                    BufferedInputStream inn = new BufferedInputStream(bodyPart.getInputStream());
                    GZIPInputStream gzin = new GZIPInputStream(inn);
                    // Open the output file
                       String target ="File"+i+fileExt;
                       OutputStream outf = new FileOutputStream(target);
                       // Transfer bytes from the compressed file to the output file
                       byte[] buff = new byte[128];
                       int lent;
                       while ((lent = gzin.read(buff)) > 0) {
                            outf.write(buff, 0, lent);
              }catch (Exception e) {
                   // TODO: handle exception
                   e.printStackTrace();
         public static void compressFile(String input,String output) {
              try {
                   // Create the GZIP output stream               
                   OutputStream out = new GZIPOutputStream(new FileOutputStream(output));
                   out =new BufferedOutputStream(out);
                   // Open the input file
                   //FileInputStream in = new FileInputStream(input);
                   InputStream in = new BufferedInputStream(new FileInputStream(input));
                   // Transfer bytes from the input file to the GZIP output stream
                   byte[] buf = new byte[524288];
                   /*int len;
                   while ((len = in.read(buf)) > 0) {
                        out.write(buf, 0, len);
                   int count;
                   while((count = in.read(buf, 0, 524288)) != -1) {
                        System.out.println(new String(buf, 0, count));
                        out.write(buf, 0, count);
                   out.flush();
                   in.close();
                   // Complete the GZIP file
                   //out.finish();
                   out.close();               
              } catch (Exception e) {
                   e.printStackTrace();
         public static byte[] getBytesFromFile(File file) throws IOException {
            InputStream is = new FileInputStream(file);
            // Get the size of the file
            long length = file.length();
            if (length > Integer.MAX_VALUE) {
                // File is too large
            System.out.println("File Len : " + length);
            // Create the byte array to hold the data
            byte[] bytes = new byte[(int)length];
            // Read in the bytes
            int offset = 0;
            int numRead = 0;
            while (offset < bytes.length
                   && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                offset += numRead;
            System.out.println("offset : " + offset);
            // Ensure all the bytes have been read in
            if (offset < bytes.length) {
                throw new IOException("Could not completely read file "+file.getName());
            // Close the input stream and return bytes
            is.close();
            return bytes;
    }Please help me asap.
    Edited by: sabre150 on 10-Feb-2011 01:50
    Moderator action : added [ code] tags to make the code readable.

    String is not a suitable container for binary data so unless the two lines
                 compressFile("test.pdf","testpdf.gzip");
                 String encodedData = new String(getBytesFromFile(new File("testpdf.gzip")));actually Base64 encode the file content you are probably corrupting your file.
    I suspect you should be Base64 encoding the compressed file and modifying the mime-type to reflect this.

  • Decode Attachment in OutLook Express .dbx with MimeUtility?

    Hi boys,
    I want to extract an attachment (encoded in base64 format) from outlook express .dbx file.
    I construct 2 classes :
    - the first extract from dbx file the attachment data and write it to disk.
    - the second read from disk and decode with MimeUtility class (JavaMail).
    The result is that the final file decoded is 600 byte less the original.
    sigh!.
    Can Anyone help me?
    Thanks Emanuele
    These are the classes :
    package dbxreader;
    import java.io.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2004</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Reading // THIS CLASS EXTRACT FROM DBX
    private BufferedReader reader;
    private FileOutputStream output;
    private boolean complete = false;
    public Reading()
    public void parse(String archive,String fileName) throws IOException
    reader= new BufferedReader(new FileReader(archive));
    boolean found=false;
    while(!found)
    String line=reader.readLine();
    if(line!=null)
    int i=line.indexOf("filename=\""+fileName+"\"");
    if(i!=-1)
    found=true;
    extractFile();
    output.close();
    reader.close();
    private void extractFile() throws IOException
    boolean finish=false;
    boolean firstAttempt=true;
    output= new FileOutputStream("solobyte.dat");
    while (!finish)
    char[] buffer=new char[2048];
    byte[] dest;
    int numberfBytes=reader.read(buffer);
    if(firstAttempt)
    dest=new byte[numberfBytes-2];
    byte[] src=new String(buffer).getBytes("iso-8859-1");
    System.arraycopy(src,2,dest,0,dest.length);
    //String stringa=new String(dest);
    firstAttempt=false;
    else
    byte[] src=new String(buffer).getBytes("iso-8859-1");
    dest=new byte[numberfBytes];
    System.arraycopy(src,0,dest,0,dest.length);
    // controllo se il file e finito
    // e scrivo l'array
    String appoggio=new String(dest);
    int index=appoggio.indexOf("------=_NextPart_");
    if(index!=-1)
    byte[] newdest=new byte[index-4];
    System.arraycopy(dest,0,newdest,0,newdest.length);
    System.out.print("Ci sono");
    String prova=new String(dest);
    finish=true;
    String prova2=new String(newdest);
    output.write(newdest);
    output.flush();
    else
    output.write(dest);
    output.flush();
    System.out.print("ciao");
    public static void main(String[] args)
    try
    Reading reading = new Reading();
    reading.parse("Posta in arrivo.dbx", "PathAssolutoW.exe");
    catch (IOException ex)
    ex.printStackTrace();
    THIS CLASS rRECONSTRUCT THE FILE
    package dbxreader;
    import java.io.*;
    import javax.mail.internet.MimeUtility;
    import javax.mail.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2004</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Decode {
    public Decode() {
    public static void main(String[] args)
    try {
    // FileInputStream file = new FileInputStream(new File("Prova.txt"));
    //FileInputStream file = new FileInputStream(new File("Temp64.txt"));
    FileInputStream file = new FileInputStream(new File("solobyte.dat"));
    InputStream stream = MimeUtility.decode(file, "base64");
    FileOutputStream output =new FileOutputStream("PathAssolutoW.exe");
    //FileOutputStream output =new FileOutputStream("PathAssolutow.exe");
    int iter=0;
    while(stream.available()>0)
    byte[] buffer=new byte[4096];
    int nbytes=stream.read(buffer);
    output.write(buffer,0,nbytes);
    output.flush();
    stream.close();
    output.close();
    // FileOutputStream output =new FileOutputStream("path.exe");
    output.close();
    catch (MessagingException ex)
    ex.printStackTrace();
    catch (FileNotFoundException ex)
    ex.printStackTrace();
    catch(IOException ex)
    ex.printStackTrace();
    }

    The situation is this :
    i have send to myself a mail with an attachment pathassolutow.exe.
    The original file info are(from right click and properties)
    - 85.854 byte dimension
    - 86.016 byte on disk
    When i launch my process (the two classes) the result is:
    - 85.237 byte dimension
    - 86.016 byte on disk
    there is a difference :
    85.854 before
    85.237 after
    If i try to launch the result file i get an error.
    I open the result file(85.237 bytes) with visual studio tool depends.
    I have get an error " NO PE SIGNATURE FOUND.This File is Not a valid win32 module.
    This application write on c a text file.
    Thanks for the reply Emanuele

  • Large Mail Attachment Affecting Mail Program

    I have an IMac G5 and use the mail program that came with OS X. The other day I attached a very large movie file to an email I wanted to send to my sister but stupidly, I forgot to compress the movie. I sent the email message but it is now suspended in the "OUT" box and completely slows down my computer and renders the mail program unusable due to its size.
    I've tried deleting the file and email, and even though it says I have, every time I force quit and come back, the file is right back in the "out" box. The little circle keeps spinning indicating that it's working but nothing happens. HOW DO I EXPONGE THIS MISTAKE FROM MY MAIL AND GET MY COMPUTER AND MAIL PROGRAM WORKING REGULARLY AGAIN?
    Please help!
    G5 Imac   Mac OS X (10.4)  

    With the Mail.app quit and using the Finder, go to Home > Library > Mail > Mailboxes > Outbox.mbox.
    Delete the Outbox.mbox folder and empty the Trash.
    Launch Mail and a new Outbox.mbox folder will be created automatically within the Mailboxes folder and this should resolve the problem.
    Depending on the size of the pre-encoded file, the Mail.app uses MIME 1.0 for attachment encoding which is the internet standard. The encoding process increases the size of the pre-encoded file by 50% or so. A 5MB file (pre-encoded) will be roughly 7.5MB after the encoding process.
    Most ISPs and email account providers have limits on the overall size of incoming and sent messages. As an example, a .Mac account has a 10MB overall message size limit for incoming and sent messages and most ISPs and email account providers have similar limits so you need to check on this limit with your ISP or email account provider and the same with the recipient's ISP or email account provider before sending such a large file via email.
    Something else to consider which I'm sure you are aware but just in case, if you can send a 20MB file (encoded size) and the recipient's incoming mail server accepts a message this large for example (which isn't likely) but the recipient has a limited amount of available incoming mail server storage space and the 20MB message exceeds the recipient's server storage space limit, the message will be rejected by the server.

  • Attachment limit

    I was wondering how you increase you attachment limit in Mail. I have a .Mac account and I thought it had something to do with that but now I am confused. I hate having to send more than one e-mail to friends to send them multiple attachments. I guess I could just send a link to my public folder with iDisk. Can anyone access my public folder given the password whether they are on a PC or Mac. Not many of my friends have a Mac.

    This is determined by the email account provider for the account - your ISP if the email account is provided by your ISP or in this case, .Mac.
    A .Mac account has a 10 MB overall message size limit for received and sent messages which is a common limit now but some providers still have a smaller limit.
    If your email account provider has a larger overall message size limit for sending messages but the recipient has a smaller limit, the message will be rejected by the recipient's incoming mail server so you must take the recipient's incoming mail server overall message size limit into consideration.
    Message attachments must be encoded before being sent and decoded when recieved. The Mail.app uses MIME 1.0 for attachment encoding/decoding which is the internet standard. The problem with MIME is it isn't very efficient. The encoding process increases the size of the pre-encoded file by roughly 50% or so. An 8 MB file pre-encoded will be roughly 12 MB in size after the encoding process placing the overall size of the message over the 10 MB limit not taking any message text into account.
    With Hotmail you can just order more space to e-mail files.
    Can you not do this with Mac Mail?
    On a per message basis?
    Not with any email client such as the Mail.app which wouldn't make any difference anyway since the overall message size limit for received and sent messages is determined by the email account provider for the sender and recipient.
    Can anyone access my public folder given the password whether
    they are on a PC or Mac. Not many of my friends have a Mac.
    Yes.
    If you're a .Mac member, you can allow other users to add or remove files from your iDisk Public folder by assigning read-write access to your folder. Assigning read-write access to your Public folder doesn't affect the other folders on your iDisk.
    IMPORTANT: If you assign read-write access to your Public folder, it's a good idea to password-protect it.
    To assign read-write access to your Public folder:
    Open System Preferences and click .Mac.
    Click iDisk, and then click the Read & Write button.
    Your available iDisk storage is affected each time someone adds or removes a file from your Public folder.
    For Mac users:
    You can open another .Mac member's Public folder to see and copy files. If the member has set access privileges to read-write, you can also add and remove files.
    To access another person's Public folder, you need to know their member name and their Public folder password (if they use one to protect the folder).
    To open someone's Public folder:
    Choose Go > iDisk > Other User's Public Folder.
    Type the member name of the person whose Public folder you want to open in the Member Name field.
    Click Connect.
    If a password is required, type it in the Password field and click OK.
    The person's Public folder opens on your desktop.
    For Windows Users:
    If you're using your iDisk to share files with Windows users, they need the following information to see and copy files in your Public folder.
    Windows users can open your iDisk using Microsoft Windows XP, Windows 2000, or Windows 98.
    To access your Public folder, the Windows user needs to know your member name and Public folder password (if your Public folder is password-protected).
    To open someone's Public folder using Windows:
    If you're using Windows XP, use iDisk Utility for Windows to open someone's Public folder. To download iDisk Utility for Windows, go to www.mac.com, and click "iDisk Utility for Windows XP."
    If you're using Windows 2000, open My Computer, choose Map Network Drive from the Tools menu, then click "Web folder or FTP site." Enter the following as the location to add: http://idisk.mac.com/membername-Public? (where "membername" is the other person's .Mac member name).
    If you're using Windows 98, open My Computer, double-click the Web Folders icon, then double-click Add Web Folder. Enter the following as the location to add: http://idisk.mac.com/membername-Public? (where "membername" is the other person's .Mac member name).
    You can also use HomePage to create a file sharing page.

  • How to set defaul email client to Entourage

    I have Entourage 08 and I have set a million times in Preferences\General to have Entourage as my defaul e-Mail client and yet whenever I see a link to send or attach as email, say a file in Preview app, I am always taken to the Apple Mail app which I have not setup or even bothered opening.  How can I finally and forever fix Entourage as my permanent email client?
    I prefer Entourage over Mail.
    Am I doing it wrong?
    Thank you.

    Linc Davis wrote:
    Create Service to “Add Attachment to new Entourage Message” | OfficeforMacHelp.com
    Thank you!.  It worked if I am in the Finder and right-clicking an item to attach to Entourage.
    I am more interested in this scenario:
    I am within Preview app viewing a PDF document.  Under File>Mail Selected PDF Document, i wanted this by default to open Entourage and not Apple Mail.
    I have discovered that for some reason, Firefox, Safari, and Office for Mac now have Entourage as default client.  Its the Preview app that keeps opening the Apple Mail whenever I choose "Mail Selected PDF Document" from the File menu.

  • Entourage: iPhoto 9.4.1 not working!

    I've found both 9.4 and 9.4.1 to be unstable. They are slower than previous versions, do not recognize or load my SD cards (it takes several insertions/ejections) and the worst part I can't email from Entourage. That feature was working in 9.4 for a moment, until I had mistakingly deselected "include file names and descriptions" and it crashed. After the crash, it's not an option at all. In previous iPhoto versions, this was a bug and you just had to keep those boxes checked to send iphotos via Enourage. That was an easy work-around.
    Now I can't send it at all. Only through iPhoto and Mail. Outlook is greyed and Entourage isn't there.
    Is Apple slipping?
    The latest software "updates" are seemily disappointing downgrades. It's sad, but worse cutting into my productivity.

    Appearently entrouge support has been dropped
    Report to apple. IPhoto menu ==> provide iPhoto feedback
    To work around you can export photos to a desktop folder sizing during the export and attach from there, drag photos to Entourage or attach using the Entourage attach command and the media browser in the lower left hand corner of to attach window
    LN

  • Attaching large files

    When I reduce a tiff. photo in Photoshop and in Mail attach it to an email it reverts the size back to the original photo size( which is to large to mail). In Photoshop the Image size says its been reduced, it shows the size has been reduced, its been saved to my desktop. Yet when I attach it to Mail its back to the original size. What the hey am I doing wrong?
    Thanks in advance.

    As Stanley provided, all message attachments must be encoded before being sent or during the sending process and decoded when received.
    Mail uses MIME 1.0 for attachment encoding/decoding which is the internet standard. The problem with MIME is it isn't very efficient. The encoding process increases the size of the pre-encoded file by roughly 50% or so.
    A 6 MB file (pre-encoded) will be roughly 9 MB in size after the encoding process.
    This is not unique to Mail - the same applies to any email client.

Maybe you are looking for