php - Sympfony2 deleting file by name or path using Filesystem -


please suggest how remove file/image using filesystem. documentation on symfony website not clear mentions array...

i tried this:

$fs = new filesystem(); $fs->remove('name.jpeg'); 

and:

unlink('name.jpeg');

i read this, did not help:

symfony how remove file

i tried using path, , path+name. perhaps there special way of getting path. thank you

it turned out way path:

$path = $this->container->getparameter('kernel.root_dir') . '/../folder1/folder2/name.jpeg';  $fs = new filesystem(); $fs->remove($path); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -