This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting the parameters from multipart/form-data

 
Jim Halpert
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My JSP:

My Servlet:


In the console you will see 'Title: null'
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The getParameter() family of methods will not work with anything other than data encoded as x-www-form-urlencoded.

if you are using a 3rd-party library to assist in the file upload, it will have methods to fetch the parameters. If you are parsing the multi-part request yourself (not recommended!), well, then you need to parse out the parameters yourself.
 
Jim Halpert
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using:
commons-fileupload-1.2.2.jar
&
commons-io-2.0.1.jar

Do you know which method to call so I can get the parameters? (I could not find anything in the API list)

 
olivier dutranoit
Ranch Hand
Posts: 81
IBM DB2 Eclipse IDE Java
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
everything is explained very well in here:

http://commons.apache.org/fileupload/using.html
 
Jim Halpert
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
olivier dutranoit wrote:everything is explained very well in here:

http://commons.apache.org/fileupload/using.html


That helped me alot, I got it working!! Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic