I am trying to save images in a database using forms and Doctrine. In my essence, I did this:
private $photo; private $file; public function upload() { if (null === $this->file) { return; } $this->setPhoto(file_get_contents($this->getFile())); }
And I also added this to my form type:
->add('file', 'file')
But I get this error when downloading a file:
Serialization of 'Symfony \ Component \ HttpFoundation \ File \ UploadedFile' is not allowed
php symfony blob doctrine
Theflow_
source share