Unlink function not works in laravel after creating a zip file
I m using a package called zipper in laravel to create zip files. Files are stored in a folder and filenames in the db table. after creating zip files , the remaining files i have to delete from the folder.But while using the below code unlink/File::delete() was not working. code looks like as below
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$zipFileClass = new Zipper(); $getDate = date("Ymd"); $getTime = time(); $newFileName = 'mynewfile_' . $getDate . '_' . $getTime . '.zip'; $zipFileClass->make($save_file_path. '/' . $newFileName)->add($FilenameDetails); } foreach ($FilenameDetailsas $key => $val) { if(file_exists($save_file_path.'/'.$val)) { unlink($file_path.'/'.$val); } } |