I use Vichuploader to simplify the upload. Everything seems to work perfectly, meaning that when i upload for the first time the CV for an employee, it works. (the entity CV is related to User by a foreign key) i m able to read the document. but when an employee already has a CV and try to upload a new one, i have an exception saying "The file "xxxx.pdf" was not uploaded due to an unknown error.". but everything works, the new CV is uploaded in the directory, and the database is complete with the right name and updated date.(and the user id as a foreign key) so i don't know why the method "move()"(in the vendor) is throwing an exception...
here s the controller:
$cv =new Cv();
$form = $this->createForm(CvFormType::class, $cv);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
if($userCv){
$userCv->setCvFile($cv->getCvFile());
$em->flush();
}
$cv->setUser($collab);
$em->persist($cv);
$em->flush();
}
If somebody could help, that would really make my day! thanks!