dcsimg
Rxd attachments from Microsoft Exchange, using IMAP protocol.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alan_Williamson
Posted On:   Saturday, July 7, 2001 11:03 AM

Having looked extensively through all the FAQs and previous posts, i couldn't find anyone that was having the same problem as myself. I am connected onto an Exchange Server using the latest JavaMail with IMAP. Everything hunky dory so far ... can read folders, move emails, delete messages, read messages. However the problem comes when downloading attachments, irrespective of the size. When i examine the byte size for the original file and again when it is downloaded, they are PERFECT. But the file is corrupt. I have tried the 'mail.imap.prefetch=false' trick, but no joy. Here is my code for downloading the actual attachment; BufferedInputStream in = new BufferedInputStream(   More>>

Having looked extensively through all the FAQs and previous posts, i couldn't find anyone that was having the same problem as myself.


I am connected onto an Exchange Server using the latest JavaMail with IMAP. Everything hunky dory so far ... can read folders, move emails, delete messages, read messages.


However the problem comes when downloading attachments, irrespective of the size. When i examine the byte size for the original file and again when it is downloaded, they are PERFECT. But the file is corrupt.


I have tried the 'mail.imap.prefetch=false' trick, but no joy. Here is my code for downloading the actual attachment;

			
BufferedInputStream in = new BufferedInputStream( Mess.getInputStream() );
BufferedWriter out = new BufferedWriter( new FileWriter( attachDIR + filename ) );

int charIn;

while ((charIn = in.read()) != -1)
out.write( charIn );

out.flush();
out.close();
in.close();




Any help or assistance would be appreciated. thanks    <<Less

Re: Rxd attachments from Microsoft Exchange, using IMAP protocol.

Posted By:   Alan_Williamson  
Posted On:   Saturday, July 7, 2001 11:37 AM

DOH ... what a silly mistake !!!!


The BufferedWriter is the cause of the problem, replace it with a BufferedOutputStream and no translation of the 'int' occurs.


kinda answered my owner question eh??


;-)

Re: Rxd attachments from Microsoft Exchange, using IMAP protocol.

Posted By:   Alan_Williamson  
Posted On:   Saturday, July 7, 2001 11:16 AM

Just to add another ingredient into the pot ... when i receive TEXT attachments it works perfectly.

This is suggesting to me that BINARY attachents is the problem and some sort of encoding issue.
About | Sitemap | Contact