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:
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
Post a Comment