You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Mihael Knezevic <m....@porta.de> on 2005/05/06 16:18:41 UTC

[FileUpload] How to pass parameter along with the upload file in a multipart/form-data

hi,

i got the uploading of a file running but now i want to pass some parameter 
with it. what do i need to put in the html form and how do i get it from the 
request object?

my html form:

<form  ENCTYPE='multipart/form-data' method='POST' frm='frmUploadCatalog' 
action='CatalogManagement'>
 <input type='hidden' name='action' value='uploadCatalog'>
 
 <div align='center'><h4>Katalog hochladen</h4></div>
 
 Wählen Sie einen Katalog aus: <input type='file' name='catalog'>
 
 <br><br>
 
 <input type='radio' name='type' value='file' checked> als einzelne Datei
 
 <br>
 
 <input type='radio' name='type' value='jar'> als Archivdatei (mehrere 
Dateien)
 
 <br><br>
 
 <input type='submit' name='absenden' value='hochladen'>
 
</form>

i like to get the value of the input field with the name type (radio buttons) 
but don't know how.

thanx in advance.

mk

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [FileUpload] How to pass parameter along with the upload file in a multipart/form-data

Posted by Martin Cooper <mf...@gmail.com>.
Take a look at the FileUpload user guide:

http://jakarta.apache.org/commons/fileupload/using.html

and you'll see that all of the items - file items and non-file items -
are returned in the list from parseRequest(). You distinguish between
file items and non-file items using the isFormField() method.

--
Martin Cooper


On 5/6/05, Mihael Knezevic <m....@porta.de> wrote:
> hi,
> 
> i got the uploading of a file running but now i want to pass some parameter
> with it. what do i need to put in the html form and how do i get it from the
> request object?
> 
> my html form:
> 
> <form  ENCTYPE='multipart/form-data' method='POST' frm='frmUploadCatalog'
> action='CatalogManagement'>
>  <input type='hidden' name='action' value='uploadCatalog'>
> 
>  <div align='center'><h4>Katalog hochladen</h4></div>
> 
>  Wählen Sie einen Katalog aus: <input type='file' name='catalog'>
> 
>  <br><br>
> 
>  <input type='radio' name='type' value='file' checked> als einzelne Datei
> 
>  <br>
> 
>  <input type='radio' name='type' value='jar'> als Archivdatei (mehrere
> Dateien)
> 
>  <br><br>
> 
>  <input type='submit' name='absenden' value='hochladen'>
> 
> </form>
> 
> i like to get the value of the input field with the name type (radio buttons)
> but don't know how.
> 
> thanx in advance.
> 
> mk
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [FileUpload] How to pass parameter along with the upload file in a multipart/form-data

Posted by Dakota Jack <da...@gmail.com>.
Well, we are talking a lot, Mihael.  You might take a look at a bunch
of code I wrote that uses commons upload that I tried to integrate
into Struts, but they wanted their own "proprietary" solution.  The
code is at http://wiki.apache.org/struts/StrutsUpload?highlight=%28Upload%29
and this should answer these questions.



On 5/6/05, Mihael Knezevic <m....@porta.de> wrote:
> hi,
> 
> i got the uploading of a file running but now i want to pass some parameter
> with it. what do i need to put in the html form and how do i get it from the
> request object?
> 
> my html form:
> 
> <form  ENCTYPE='multipart/form-data' method='POST' frm='frmUploadCatalog'
> action='CatalogManagement'>
>  <input type='hidden' name='action' value='uploadCatalog'>
> 
>  <div align='center'><h4>Katalog hochladen</h4></div>
> 
>  Wählen Sie einen Katalog aus: <input type='file' name='catalog'>
> 
>  <br><br>
> 
>  <input type='radio' name='type' value='file' checked> als einzelne Datei
> 
>  <br>
> 
>  <input type='radio' name='type' value='jar'> als Archivdatei (mehrere
> Dateien)
> 
>  <br><br>
> 
>  <input type='submit' name='absenden' value='hochladen'>
> 
> </form>
> 
> i like to get the value of the input field with the name type (radio buttons)
> but don't know how.
> 
> thanx in advance.
> 
> mk
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org