Upload image to web folder in Symfony2

0

Hello, I am working on a project with Symfony2 and I have problems when uploading an image to the web folder of the project.

With this I get the image from the html form:

$file = $request->files->get('file');

this is the directory I want to upload it to:

 $ficha='web/imagenes/'.$servicio->getId().'.jpg';

with this supposedly the image should upload the web / images folder:

move_uploaded_file($file,$this->container->getparameter('upload_dir').'/../'.$ficha);

this is the parameter in parameters.yml

 upload_dir: %kernel.root_dir%/../web/uploads

Any ideas?

    
asked by Felix A Marrero Pentón 17.11.2017 в 04:19
source

0 answers