dcsimg
Processing attachments that are not multipart
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hannes_Prokop
Posted On:   Wednesday, December 3, 2003 04:14 AM

I am redesigning an application that has to process files coming as mail attachments. I use the following code to process incoming attachments: String contentType = mimeMsg.getContentType(); if (contentType.indexOf("multipart/mixed")>=0){ for (int m=0; m BodyPart bp = mp.getBodyPart(m); String attachmentName = bp.getFileName(); //process attachment } } That works fine as long as the incoming messages have text along with the attached file (then they are multipart). When I receive a message with no text (only the file) then the message is of type "application/*" and I don't know how to handle th   More>>

I am redesigning an application that has to process files coming as mail attachments. I use the following code to process incoming attachments:


			
String contentType = mimeMsg.getContentType();

if (contentType.indexOf("multipart/mixed")>=0){

for (int m=0; m

BodyPart bp = mp.getBodyPart(m);

String attachmentName = bp.getFileName();

//process attachment

}

}




That works fine as long as the incoming messages have text along with the attached file (then they are multipart). When I receive a message with no text (only the file) then the message is of type "application/*" and I don't know how to handle them.



I need something similar to the MimeBodyPart Class but MimeBodyParts are only included in Multipart Messages. Does anyone know another way to process attachments that come as "application/*"?



Thanks in advance

Hannes

   <<Less

Re: Processing attachments that are not multipart

Posted By:   Sergey_Bredikhin  
Posted On:   Friday, December 19, 2003 03:53 AM

Hello

If you want, you may download
the source code of my mail web-client.

http://sbredikhin.narod.ru/oliva_en.htm

Probably, you will find the answer there.
About | Sitemap | Contact