[
http://www.stripesframework.org/jira/browse/STS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tim Fennell resolved STS-265.
-----------------------------
Resolution: Won't Fix
Even though there is a workaround I'd kind of like to fix this. However, when
I went to take a look at how to do it I found out why we have this bug in the
first place! The COS library (the default we use for multi-part parsing) only
supports one file per request parameter name. If you send in multiple you'll
just get the last one back (defined by the order the browser sent them).
So unless we want to fix up COS, or through it out entirely and only support
commons, we're stuck with one parameter name == one file upload. As Ben said,
there's an easy workaround for this, so I think we'll just close this bug.
> Support for multiple file uploads with the same parameter name in one request
> -----------------------------------------------------------------------------
>
> Key: STS-265
> URL: http://www.stripesframework.org/jira/browse/STS-265
> Project: Stripes
> Issue Type: Improvement
> Components: ActionBean Dispatching
> Affects Versions: Release 1.4
> Reporter: Tim Fennell
> Assignee: Tim Fennell
> Fix For: Release 1.5
>
> Attachments: fileupload-1.4.2.patch
>
>
> From Gregg Bolinger on the user list:
> I am building a page for the user to upload up to 5 images at the same time.
> Initially, I had a property for each FileBean in the action bean. imageFile1,
> imageFile2, etc. with getters and setters for each. The problem is it's
> quite a pain, and a lot of code, to check each one to make sure there is an
> image file and then process the file. So I tried doing something like this:
> <stripes:file name="imageFiles"/>
> <stripes:file name="imageFiles"/>
> <stripes:file name="imageFiles"/>
> <stripes:file name="imageFiles"/>
> <stripes:file name="imageFiles"/>
> private FileBean[] imageFiles;
> public FileBean[] getImageFiles()
> {
> return imageFiles;
> }
> public void setImageFiles(FileBean[] imageFiles)
> {
> this.imageFiles = imageFiles;
> }
> However, this did not seem to work. What I would really prefer is something
> like this:
> <stripes:file name="imageFile"/>
> <stripes:file name="imageFile"/>
> <stripes:file name="imageFile"/>
> <stripes:file name="imageFile"/>
> <stripes:file name="imageFile"/>
> private List<FileBean> imageFiles;
> // getters and setters
> and then in my action I can do:
> for (FileBean fb : imageFiles)
> {
> // do all the cool stuff
> }
> Is there any way to do this currently?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development