dcsimg
How can i get attached file names with out getting whole Multipart Object in pop3 server ... ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, January 20, 2003 10:55 PM

How can i get attached file names with out getting whole Multipart Object in pop3 server ... ? it takes too much time using " Multipart multipart = (Multipart)message[ins].getContent(); " Here is mycode... ------------------------------- Folder folder = store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); Message message[]=folder.getMessages(); //FetchProfile profile=new FetchProfile(); //profile.add(FetchProfile.Item.ENVELOPE); //folder.fetch(message, profile); for(int ins=0;ins < message.length; ins++){ System.out.println("From:"+message[ins].getFrom()[0]); System.out.println("Title:"+me   More>>

How can i get attached file names with out getting whole Multipart Object in pop3 server ... ?
it takes too much time using " Multipart multipart = (Multipart)message[ins].getContent(); "



			
Here is mycode...
-------------------------------
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
Message message[]=folder.getMessages();
//FetchProfile profile=new FetchProfile();
//profile.add(FetchProfile.Item.ENVELOPE);
//folder.fetch(message, profile);

for(int ins=0;ins < message.length; ins++){
System.out.println("From:"+message[ins].getFrom()[0]);
System.out.println("Title:"+message[ins].getSubject());
//System.out.println("Body:"+message[ins].getContent());
//System.out.println("AttachedFile:"+message[ins].getFileName());
// <-- it didn't work!!!

Multipart multipart = (Multipart)message[ins].getContent();
// <-- this takes so long if attached file is largs...
// and only file name is needed!!

for (int i=0; i
Part part = multipart.getBodyPart(i);
String disposition = part.getDisposition();
System.out.println("Attatchedfile:"+part.getFileName());
}


}
folder.close(false);
store.close();

-------------------------------
   <<Less

Re: How can i get attached file names with out getting whole Multipart Object in pop3 server ... ?

Posted By:   John_Zukowski  
Posted On:   Friday, January 31, 2003 08:50 PM

Without reading the whole message, there is no way to magically go to the appropriate place to only get the filename.
About | Sitemap | Contact