You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Edwin Ramirez <ed...@mssm.edu> on 2006/06/27 17:43:49 UTC

FileUpload form field issue

Hello,

I've started using the fileUpload component to handle form submissions 
containing files.  I am following a very simple example and everything 
is working as expected.  However, it seems that multi-value form 
elements are not handled properly.

For example, the select tag such as:
<select name="multi" multiple size=5>
<option>One
<option>Two
<option>Three
<option>Four

<option>Five
<option>Six
<option>Seven
<option>Eight
<option>Nine
<option>Ten
</select><br/>

will only retrieve the last item selected.

I am using the getString() method of the FileItem interface.  Is there 
another method which returns an array of values?

Thanks,

-- 
Edwin S. Ramirez
Senior Developer
Mount Sinai Medical Center
Information Technology
212-659-5614


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


Re: FileUpload form field issue

Posted by Martin Cooper <ma...@apache.org>.
On 6/27/06, Edwin Ramirez <ed...@mssm.edu> wrote:
>
> Hello,
>
> I've started using the fileUpload component to handle form submissions
> containing files.  I am following a very simple example and everything
> is working as expected.  However, it seems that multi-value form
> elements are not handled properly.
>
> For example, the select tag such as:
> <select name="multi" multiple size=5>
> <option>One
> <option>Two
> <option>Three
> <option>Four
>
> <option>Five
> <option>Six
> <option>Seven
> <option>Eight
> <option>Nine
> <option>Ten
> </select><br/>
>
> will only retrieve the last item selected.


No, it will result in N separate FileItem instances, one for each selected
item.

I am using the getString() method of the FileItem interface.  Is there
> another method which returns an array of values?


There is no array of values, unless you build one. Each value is a separate
item.

--
Martin Cooper


Thanks,
>
> --
> Edwin S. Ramirez
> Senior Developer
> Mount Sinai Medical Center
> Information Technology
> 212-659-5614
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>