I'm having trouble uploading a file, when I dump the data returned by $form->getData(), the file field is always null. Also, if I do $this->getRequest()->files->all() I get an empty array().
This is the field definition in my form type:
->add('card_file', 'file', array(
'label' => 'Examinar',
'required' => false,
)
)
And this is how I print the field in the .twig file:
<fieldset class="fieldset__upload">
{{ form_widget(addressForm.card_file) }}
</fieldset>
The tag is created with enctype="multipart/form-data", also, the form isValid() and the file is about 4kb in size, so I don't think is a problem of exceeding file size.
The form is not attached to an entity, and $form->getData() returns all other fields correctly.
Any ideas? Thank you in advance