Jakarta commons ServletFileUpload parseRequest return 0 items, migration ?
843842Jan 7 2009 — edited Jan 8 2009I used ServletFileUpload.parseRequest(request) to get my list of items, with Struts 1.3, JBoss 4.2.2GA(migrated from JBoss 4.0.5GA) I am using JDK 1.5, on myEclipse 6.6 ( migrated from myEclipse 5.5.1GA).
My file upload application used to work and ServletFileUpload.parseRequest(request) used to return non empty results as a List<FileItem>. I am not sure ( that's the frustrating part) what has changed, but now I am getting a empty list!
I have switched to previous version of JBoss 4.0.5.GA, and myEclipse 5.5.GA and still it didn't work. I know what I need to have for this to work, i.e. :
JSTL tag in JSP:
<html:form enctype="multipart/form-data"....>
<html:file styleId="uploadFile" property="uploadFile" size="40" />
My FormBean has uploadFile as FormFile and getter and setter for it.
I wrote a Utility class to include this apache commons fileupload API and my action class calls the Util class.
The Util class looks like this:
DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List<FileItem> items = (List<FileItem>) upload.parseRequest(request);
Like I said, items used to return non-empty results and I was uploading file just fine. I am using Struts 1.3, Spring 2.0, which hasn't changed. And even though my myEclipse and JBoss version changed, I did revert back to the previous version just to test them and still am getting empty list.
I am pulling my hair out on this, I'd really appreciate any input and if you need more info, I'd be happy to replenish them!
Thanks in advance!