For Programmers: Free Programming Magazines  


Home > Archive > Java Help > December 2004 > Uploading Files Using MultipartRequest while Parsing Other Params









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Uploading Files Using MultipartRequest while Parsing Other Params
Ones Self

2004-12-25, 9:01 pm

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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com