Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

multipart form data, sending additional data

 
Neeraj jain
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using apache-commons-fileupload to get file from client to the server.(using JSP and Servlet).

JSP/HTML




Servlet: GetFile



I am able to upload the file to the server, but I am not able to get the value of text1 in the servlet (I am getting null value of text1 in the servlet), I need this textfield in the form to submit some additional information while uploading it to the server.

--> Is enctype="multipart/form-data" option of form doesn't allow other form data to be submited? if it doesn't allow it then what are the other options I have to send this additional textfield to the server.
--> Or is there any other problem in my code?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getParameter() (and cousins) doesn't work with multi-part requests. You'll need to use the API provided by the commons library.

See the ServletsFaq
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!