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