struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JOSE L MARTINEZ-AVIAL <jlm...@gmail.com>
Subject Re: Multiple FormFile Uploads in Struts 1
Date Fri, 28 Oct 2011 22:02:07 GMT
In the JSP

<input type="file" id="file0" name="filetoUpload" /><br />
<input type="file" id="file1" name="filetoUpload" /><br />
<input type="file" id="file2" name="filetoUpload" /><br />
<input type="file" id="file3" name="filetoUpload" /><br />


2011/10/28 JOSE L MARTINEZ-AVIAL <jlmagc@gmail.com>

> This works for me.
>
>     private File fileToUpload[];// The actual file
>     private String fileToUploadContentType[]; // The content type of the
> file
>     private String fileToUploadFileName[]; // The uploaded file name
>
>     public void setFiletoUpload(File upload[]) {
>         this.fileToUpload = upload;
>     }
>
>     public void setFiletoUploadContentType(String uploadContentType[]) {
>         this.fileToUploadContentType = uploadContentType;
>     }
>
>     public void setFiletoUploadFileName(String uploadFileName[]) {
>         this.fileToUploadFileName = uploadFileName;
>     }
>
> 2011/10/28 Sekar, Sowmya <ssekar@ucsd.edu>
>
> Hi,
>> Does anyone have a working solution of multiple formfile uploads? I
>> declared the formfile as an arraylist and indexed the property in the jsp
>> files. I also changed the setter and getter methods to take the index and
>> formfile object. However, when I save the form, it throws "argument type
>> mismatch error"
>>
>> Any ideas?
>>
>> Sowmya
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message