Corrupted attachments
1 posts in topic
Flat View  Flat View

Posted By:   Gianluca_Sartori
Posted On:   Tuesday, December 18, 2001 05:52 AM

I can't download correctly some kind of files attached to a mail message. I had this problem with zip, jar, pdf files, but NEVER with any other file type. The received file is larger than the sent file: what's wrong?

Re: Corrupted attachments

Posted By:   Gianluca_Sartori  
Posted On:   Thursday, January 17, 2002 12:09 AM

I know it is stupid to answer your own questions, but, since nobody else will answer, I will do it myself.
The mistake I was making was to rely on the getSize() method invoked on a bodypart. The method returned the right value for most kind of attachments, but it returned a wrong size for the files I mentioned in my question.

I solved the problem reading the content stream until I reached the end of the stream instead of reading getSize() bytes from it.
About | Sitemap | Contact