wood burning stoves*
The moose likes Servlets and the fly likes Upload file and fetch other parameters as well... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Upload file and fetch other parameters as well..." Watch "Upload file and fetch other parameters as well..." New topic
Author

Upload file and fetch other parameters as well...

Mandy S Smith
Greenhorn

Joined: Jan 20, 2002
Posts: 24
I am using oreilly's MultiPartRequest class to upload file on to server. I have a form which has browse button with text field to upload the file and as well as some text fields that i need to fetch their values along with this upload stuff.
As i have this ENCTYPE = multipart/form-data attribute in my <FORM> tag, its not allowing me to fetch other text field values at all. Is there a way that i acheive this ie fetch both the text field values as well as the file name to be uploaded.
Appreciate your help.
I would greatly appreciate if anyone can respond.
Thank you.
Parag Shah
Greenhorn

Joined: Jan 23, 2002
Posts: 26
If you are using O'Reilly's Multipart Request, you must use their MultipartParser class to read the other parameters. I have used it succesfully a long time back. You will have to check the API of MultipartParser.java to instantiate and use it.
Hope it helps.
Parag


http://diycomputerscience.com
Do It Yourself Computer Science
Mandy S Smith
Greenhorn

Joined: Jan 20, 2002
Posts: 24
Thanks, i already found out and have implemented using MultiParser and i am able to fetch all the parameters.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

It's possible to get other request parameters from the MultipartRequest class. You just have to use it correctly.
Sunny Liu
Ranch Hand

Joined: Mar 15, 2002
Posts: 63
Mandy,
check this http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=7&t=007605
You can use my class to get parameter and files.
Once you construct HttpUploader with request and response. you will be able to use HttpUploader just like request object.
I wish it will help you out.


If I am rich, I will spend more.<p>IBM 486 (OOAD & UML) & 141 (XML) passed<br />Oracle 1Z0-007 passed<br />MCSD MCDBA MCSE <br />SCJP SCSSA<br />CCNA CNA A+
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Upload file and fetch other parameters as well...
 
Similar Threads
problem with multipart/form-data
Best Ajax framework for Jsp/Servlet based Web Application DWR or jQuery?
need help in enctype
File upload problem
html:form enctype="multipart/form-data"