I want to upload multiple files with POST request (without Ajax). Can I use Symfony 2\'s form collection field with type file like this:
Code in Entity:
To actually render input types you will need to set the allow_add option in the collection to true and use the form prototype of the collection, javascript and a button to add file fields.
An example based in the documentation (Collection- adding and removing)
The form:
The script:
This is just an idea, there is still plenty to do depending on your needs. If this wasn't what you were looking for, maybe you could call the add button click as a workaround.