You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2011/02/14 10:40:57 UTC

[jira] Resolved: (WICKET-3370) Extend multiple file handling to IMultipartWebRequest

     [ https://issues.apache.org/jira/browse/WICKET-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-3370.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-RC2

With r1070416  FileUploadField has method getFileUploads() which returns a list of all uploaded files in the current request.
The old method #getFileUpload() is still there and returns just the first uploaded file.

And example is added in wicket examples - UploadPage.(java|html).

> Extend multiple file handling to IMultipartWebRequest
> -----------------------------------------------------
>
>                 Key: WICKET-3370
>                 URL: https://issues.apache.org/jira/browse/WICKET-3370
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M3
>            Reporter: Willis Blackburn
>            Assignee: Martin Grigorov
>             Fix For: 1.5-RC2
>
>
> HTML 5 allows a new attribute with file input tags called "multiple," which lets the user choose multiple files to upload.  It works for me in Safari 4 and Firefox 3.6.  It probably works in Chrome and probably doesn't work in IE (like everything else).
> So I set about creating a MultiFileUploadField that uses a List<FileUpload> as its model.  Unfortunately it looks like while MultipartServletWebRequestImpl does a fine job of parsing out each file in the multi-file upload, the IMultipartWebRequest interface isn't up to the task:  it assumes that each field only has one file.
> I think that it would be straightforward to make IMultipartWebRequest map field names to List<FileItem> instead of just FileItem.  The existing FileUpload field (and indeed any other user of this interface) could just use the first FileItem in the list, or the last, if it really wanted to reproduce the existing behavior exactly (in which each new file for some field "f" overwrites the previous one in the map, leaving the last).
> Alternately there could be a couple of new methods:
> public Map<String, List<FileItem>> getFileLists();
> public List<FileItem> getFileList(final String fieldName);
> with the other two methods retaining the old behavior.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira