hi mavens,
i'm useing jakarta.apache.org commons's fileupload to
reduce my work via providing fileupload function.
however, there's a problem occurred when trying to
integrated with struts. in struts's function
perform(...), the code is as follow:
try{
boolean isMultipart =
FileUpload.isMultipartContent(request);
DiskFileUpload upload = new DiskFileUpload();
List items = upload.parseRequest(request);
System.out.println("items.size():"+items.size());
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
if (item.isFormField()) {
// processFormField(item);
mapping.findForward("error.notuploadfileobject");
} else {
processUploadedFile(item);
}
}
}catch(FileUploadException f){
f.printStackTrace();
}
the output stream to console
[System.out.println("items.size():"+items.size());]
shows that the size of items size is always zero.
would anyone be able to tell me the reason why?
i appreciate it, sincerely.
thank you very much.
ps:i'm sure the code are ok, for first, it works if
coded in jsp and it's copied from the fileupload website.
-----------------------------------------------------------------
每天都 Yahoo!奇摩
海的顏色、風的氣息、愛你的溫度,盡在信紙底圖
http://tw.promo.yahoo.com/mail_premium/stationery.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]