Posted By:
Arti_Gupta
Posted On:
Wednesday, April 17, 2002 02:57 AM
this is the segment of code i am using to read the attachments in a mulipart/mixed message Message m = fldr.getMessage(msgnum); Multipart mp = (Multipart)m.getContent(); Part part = mp.getBodyPart(partNum); String sct = part.getContentType(); if (sct==null) { out.println("invalid part"); return; } ContentType ct = new ContentType(sct); res.setContentType(ct.getBaseType()); InputStream is = part.getInputStream(); int i; while ((i=is.read())!= -1) out.write(i); My problem is that it w
More>>
this is the segment of code i am using to read the attachments in a mulipart/mixed message
Message m = fldr.getMessage(msgnum);
Multipart mp = (Multipart)m.getContent();
Part part = mp.getBodyPart(partNum);
String sct = part.getContentType();
if (sct==null)
{
out.println("invalid part");
return;
}
ContentType ct = new ContentType(sct);
res.setContentType(ct.getBaseType());
InputStream is = part.getInputStream();
int i;
while ((i=is.read())!= -1)
out.write(i);
My problem is that it works well for text/plain attachment but for the rest it does not decode them... Please suggest what to do?
thanking you in anticipation
<<Less