public function uploadFile(\Novuscom\CMFBundle\Entity\File $entity, $path = false) { if (!$path) { $path = $this->container->getParameter('upload_directory'); } $file = $entity->getFile(); $file->move($path, $entity->getName()); }