upload.parseRequest(request) returns empty list in commons.fileUpload

不羁岁月 提交于 2019-12-05 20:32:52

I encountered this same problem with a similar setup in Tomcat. The solution was as simple as placing a name attribute on my input file element.

Before I had <input type="file" /> in my HTML form.

Once I added a name tag i.e. <input type="file" name="aFile" /> my DiskFileUpload object stopped returning an empty list when I called parseRequest(request) from the servlet/JSP.

I'm using jboss 5.1 and have no troubles using commons-fileupload libs. Make sure you have the right version of jboss 4.0.4 (jre 1.6) as it may only support jre 1.5. You may want to consider upgrading to the next version if 1.6 is a requirement or change your jre to 1.5.

You should post more of you java and JSP code so we can see how you are posting the request. Good Luck

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!