php - Catchable Fatal Error: Argument 1 passed to \Entity\Image::setFile() must be an instance of Symfony\Component\HttpFoundation\File\UploadedFile, -
i got error
catchable fatal error: argument 1 passed swaam\imageuploaderbundle\entity\image::setfile() must instance of symfony\component\httpfoundation\file\uploadedfile,
instance of swaam\imageuploaderbundle\entity\image given, called in d:\xamp\htdocs\shams\vendor\symfony\symfony\src\symfony\component\propertyaccess\propertyaccessor.php on line 438 , defined in d:\xamp\htdocs\shams\src\swaam\imageuploaderbundle\entity\image.php line 166
according mention line no 166 function setfile() here function
public function setfile(uploadedfile $file = null) { $this->file = $file; // check if have old image path if (isset($this->path)) { // store old name delete after update $this->temp = $this->path; $this->path = null; } else { $this->path = 'initial'; } } i couldn't understand error , 1 please help me , explain bit reason of error plus possible solution.
i've got similar error message. solved adding <form method="post" {{ form_enctype(form) }}> form tag.
php symfony2
No comments:
Post a Comment