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.