I am trying to create a form with multiple files. Since the docs are pretty vague:
I decided to use the W3C FileReader API (based on the doc addresses below) to process files from the client and manage the underlying data from view to entity. Currently supports drag & drop, metadata, and multiple client selections.
But I want to give the UploadedFile object another chance, and the MAIN problem I have is that I cannot make a file property in my entity (type FileUpload) to store multiple files. My input is as follows:
<input type="file" id="upload_files" name="upload[files][]" required="required" multiple="multiple" />
In theory, if I had made the name an array, the file file should contain files, but it is not. Can an UploadedFile store multiple files? or just one?
http://api.symfony.com/2.2/Symfony/Component/HttpFoundation/File/UploadedFile.html
Also tried to initialize (in the __constructobject) the property $filesas an array and change setFiles()to store the new index of the array $this->files[] = $file;... you know.
But then Symfony tells me that the exception is:
, Symfony\Component\HttpFoundation\File\File, (n) . , "data_class" , (n) Symfony\Component\HttpFoundation\File\File.
. , . UploadedFile .
... . - FileUpload , ?
github: https://github.com/jeflopo/fileupload
: