• Post Reply Bookmark Topic Watch Topic
  • New Topic

Postiong to a servlet using enctype="multipart/form-data"  RSS feed

 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there folks, could some one give some idea on how to do this

I want to post form data using multipart as I have some documents to upload as well as data. Now cause my forms are dynamic I don't know what or how many form fields will be present, causeI have to catch with getParameterNames and then orgainise the elements.

Now this is not working when my form enctype is multipart, what methods or approach should I take to solve this, a code snippet would be really helpful.

Cheers

Reg

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With multipart forms you can not retrieve your parameters with getParameter. The way you retrieve them is specific to the upload libraries you are using.
I use this one:
http://jakarta.apache.org/commons/fileupload/
 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers, I downloaded the multipart package from servlet.com that a an elegant solution, I was up and running in no time at all.

Reg
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!