File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes getting the parameters from multipart/form-data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "getting the parameters from multipart/form-data" Watch "getting the parameters from multipart/form-data" New topic
Author

getting the parameters from multipart/form-data

Jim Halpert
Greenhorn

Joined: Sep 26, 2011
Posts: 6
My JSP:

My Servlet:


In the console you will see 'Title: null'
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jim Halpert
Greenhorn

Joined: Sep 26, 2011
Posts: 6
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

Joined: Aug 20, 2011
Posts: 81

everything is explained very well in here:

http://commons.apache.org/fileupload/using.html
Jim Halpert
Greenhorn

Joined: Sep 26, 2011
Posts: 6
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
 
subject: getting the parameters from multipart/form-data