0

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.

Damaged Organic
  • 8,175
  • 6
  • 58
  • 84
J.Ghassen
  • 101
  • 1
  • 1
  • 12

1 Answers1

1

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

Damaged Organic
  • 8,175
  • 6
  • 58
  • 84