i have a problem with my editAction(), It looks like it the problem is with path:
"The file "G:\xampp5.6\htdocs\future\future/web/uploads/images/G:\xampp5.6\tmp\phpB0E6.tmp" does not exist" .
I dont know what can i do.
/**
* Displays a form to edit an existing blog entity.
*
* @Route("/{id}/edit", name="blog_edit")
* @Method({"GET", "POST"})
*/
public function editAction(Request $request, Blog $blog)
{
$blog->setImage(
new File($this->getParameter('image_directory').'/'.$blog->getImage()));
$deleteForm = $this->createDeleteForm($blog);
$editForm = $this->createForm('AppBundle\Form\BlogType', $blog);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {
$this->getDoctrine()->getManager()->flush();
return $this->redirectToRoute('blog_edit', array('id' => $blog->getId()));
}
return $this->render('blog/edit.html.twig', array(
'blog' => $blog,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
EDIT: How can I set correct paths? Because in my database path is G:\xampp5.6\tmp\phpA7BF.tmp and should only name image for example fa7bcdd50522b0592c5f98ab8313041.jpeg
$blog::$image? Looks like it already contains the full path to your imageG:\xampp5.6\htdocs\future\future/web/uploads/images/G:\xampp5.6\tmp\phpB0E6.tmp$blog->setImage(). anyway the issue is not in this code snippet