Uploading Files Using MultipartRequest while Parsing Other Params

From: Ones Self (nutgg001_at_sneakemail.com)
Date: 12/25/04


Date: 25 Dec 2004 11:59:13 -0800

Hi,

I'm using Tomcat 4.1.31 with Velocity 1.4, and I'm trying to upload a
file to my servlet using O'Rielly's MultipartRequest class
(http://www.servlets.com/cos/). The problem is that I'm submitting a
page which contains other input fields (other then the file path), and
I need to process those in addition to saving the file to disk.
However, when I try to submit the form I don't get the other input
fields. For example:

<form name="uploadForm1" action="SaveForm" method="POST"
ENCTYPE="multipart/form-data">
Text: <input type='text' name='text1'><br>
File: <input type='file' name='pic1'><br>
<input type='submit' name='upload' value='Upload'>
</form>

In this case I will not get the "text1" input field in the
HttpServletRequest object. Are these values available anywhere in the
request other then the "getParameter" method?

Thanks



Relevant Pages