I want to upload a html file using symfony but always I get an error
Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed
the code of my class docuement is given as follow
class document
{
/* ... */
private $id;
/**
* @var string
*
* @ORM\Column(name="filename", type="string", length=255, nullable=true)
*/
private $filename;
/**
* @var string
*
* @ORM\Column(name="realfilename", type="string", length=255, nullable=true)
*/
private $realfilename;
/**
* @Assert\File(
* maxSize = "5000k",
* mimeTypes = {"text/comma-separated-values", "application/pdf", "text/csv", "application/csv", "application/excel", "application/vnd.ms-excel", "application/vnd.msexcel", "application/octet-stream","text/plain"},
* )
*/
private $file
/* ... */
}
the function that can do the serialization is
$serialize = serialize($docuement);
$encodingDoc = $serviceUtils->encode($serialize, $this->container->getParameter('key_encrypt'));
when I upload a pdf file ou cvs file, everything work great, but when I try to upload html file, I get an error
Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed
any help please