I run into a problem when trying to upload images to the server using a symfony form as follows:
$form = $this->createFormBuilder($image)
->add('full', FileType::class, array('label' => 'Imagen', 'multiple' => true))
->add('save', SubmitType::class, array('label' => 'Guardar'))
->getForm();
Then in the html:
{{ form_start(form) }}
{{ form_row(form.full) }}
{{ form_end(form) }}
When I inspect the html I get:
<form name="form" method="post" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label required" for="form_full">Imagen</label>
<input type="file" id="form_full" name="form[full][]" required="required" multiple="multiple" />
</div>
<div class="form-group">
<button type="submit" id="form_save" name="form[save]" class="btn-default btn">Guardar</button>
</div>
<input type="hidden" id="form__token" name="form[_token]" value="vZjUzyZCsbsx5TmfWiljncIi1pPymfod_jezOOKgK_k" />
</form>
When I get the value of the file in the controller I have this:
So far, well, but in other cases of other images with the same format (jpeg), it happens that I get this:
As you can see it does not recognize the Mimetype that it should be image / jpeg, and it shows that an error occurs but it does not say which one?