Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Use of "MultipartParser" in com.oreilly.mulitpart  RSS feed

 
gulshan babajee
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am actually developing appln. using jsp, java.
How can I use the class MultipartParser to upload an image and at the same time take some text fields values as parameters and then retrieve each of them (i.e the image, 1st txtField value, 2nd txtField value, etc.. ) and store them in the db.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's theAPI
Choose one of the constructors
In JSP:
MultipartRequest mpr = new MultipartRequest( request, pathToSaveDirectory ... );
The uploaded file will be stored to saveDirectory automatically.
Values of other Formelements you retrieve with
String myTextfield = mpr.getParameter("myTextfield");
cb
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!