public function deleteFile(FileModelInterface $model)
    {
        $url = $model->getUploadDir() . DS . $model->getFile();

        @unlink(str_replace('..', '', $url));

        $model->delete();
    }
public function deleteFile(FileModelInterface $model)
    {
        $url = $model->getUploadDir() . DS . $model->getFile();

        @unlink(str_replace('..', '', $url));

        $model->delete();
    }
public function deleteFile ( FileModelInterface $ model ) { $ url = $ model -> getUploadDir ( ) . DS . $ model -> getFile ( ) ; @ unlink ( str_replace ( '..' , '' , $ url ) ) ; $ model -> delete ( ) ; }
Delete image from file storage and database

@param FileModelInterface $model File being deleted
Delete image from file storage and database