LeanMoreTryMore
asked on
JavaMail - How do I get the Attachment name and file type
Would anyone give me the idea how to get the attachment name and its file type?
see my code below:
protected static void handleMultipart(Multipart multipart
,String iEmailAttachmentName
,String iApplHomeDir
,String iEmailSubject
,String iIncomingEmailSubject)
throws MessagingException, IOException {
try {
for (int i=0, n=multipart.getCount(); i<n; i++) {
System.out.println("here u r ****** " + multipart.getBodyPart(i).A TTACHMENT. );
handlePart(multipart.getBo dyPart(i), iEmailAttachmentName, iApplHomeDir,iEmailSubject , iIncomingEmailSubject);
}
}
catch (Throwable e) {
e.printStackTrace();
}
} // handleMultipart
see my code below:
protected static void handleMultipart(Multipart multipart
,String iEmailAttachmentName
,String iApplHomeDir
,String iEmailSubject
,String iIncomingEmailSubject)
throws MessagingException, IOException {
try {
for (int i=0, n=multipart.getCount(); i<n; i++) {
System.out.println("here u r ****** " + multipart.getBodyPart(i).A
handlePart(multipart.getBo
}
}
catch (Throwable e) {
e.printStackTrace();
}
} // handleMultipart
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
String contentType = multipart.getContentType()