Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with commons FileUpload

 
Raj Mehta
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to use the apache fileUpload to parse multipart request. But it is ignoring all the form elements upto and including the the first file element.

This is the html code


This is the JSP code (which parses the request)


I found this code in some online tutorial. When i submit the form to the jsp it only prints out file2 & file3. If i have more form elements before file1 even they are ignored.

Has anyone encountered such a problem before ?? Btw i am running this under WSAD.

Thanks
Raj
 
sunitha reghu
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if the enctype is multipart/form-date it will take only file field. <FORM name="filesForm" action="temp.jsp" method="post" enctype="multipart/form-data">

hth,
sunitha
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've not used that Upload component.

but if you have the enctype as multipart, it doesnt mean that you can have only 1 file component or only one form component. That is wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic