0
votes

I'm trying to upload an image with VichUploaderBundle but I have this error on form submit:

Catchable Fatal Error: Argument 1 passed to PiCrowdRise\WebBundle\Entity\Probleme::setImageFile() must be an instance of Symfony\Component\HttpFoundation\File\File, string given, called in E:\wamp\www\PI\PI\vendor\symfony\symfony\src\Symfony\Component\PropertyAccess\PropertyAccessor.php on line 410 and defined

My entity screenshot

Setters and getters screenshot

Thanks for your help.

1
Please add your code directly in the question, not in image format.Michaël Azevedo

1 Answers

1
votes

Maybe you've forgot to add enctype="multipart/form-data" in <form> tag? if not please add your full code (twig, formType, entity).