[Flow] Re: Upload multiple files
Christian EÃl
essl at incert.at
Mon Sep 9 10:07:30 CEST 2013
Ok, I found out that the upload sets several variables "images.name", "images.type", "images.tmp_name" and so on, which should normally be set on a Resource-Object. This means, the upload is expecting a _single_ file and can't handle multiple files at once. (with multiple="multiple" on the upload)
So my idea for a workaround would be the following:
- I create a HTML5-Upload-Element with multiple="multiple" that doesn't persist any properties.
- With Javascript I add an Event-Listener to the Multiupload-Element, that checks if the user picked files.
- for each file picked with the Multipload-Element I automatically create a new hidden Singleupload-Element via javascript that gets one of the paths each:
<input type="file" name="newGallery[images][0][resource]" value="[path to image]" >
<input type="file" name="newGallery[images][1][resource]" value="[path to image]">
.. and so on ...
This seems a bit inconvenient, but it should work. (I think.)
More information about the Flow
mailing list