[Flow] Upload multiple files
Winfried Mingst
admin at regionalberatung.at
Mon Sep 9 12:55:05 CEST 2013
I did it similar to your workaround and it works. I used
"real-ajax-uploader", which does all that hidden things automatically.
Besides it also works with non HTML5-browsers.
Am 09.09.2013 10:07, schrieb Christian Eßl:
> 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