我用javamail api從java應用程序發送帶附件的電子郵件,它很簡單。附加文件上傳進度
File f= new File(file);
MimeBodyPart mbp2 = new MimeBodyPart();
try {
mbp2.attachFile(f);
} catch (IOException e) {
e.printStackTrace();
}
Multipart mp= new MimeMultipart();
mp.addBodyPart(mbp2);
message.setContent(mp);
,但我想的就是要知道的是如何知道我的附件的上傳進度,不像HttpClient的我無法找到一個OutputStream來的writeTo! 謝謝!
親愛的Toilal,是否有可能重寫getInputStream()來retyrn一個FilterOutputStream? – wathmal