I'm trying to zip files selected by the user but for some reason I'm getting this error.
I'm using laravel 4.2
Here is the portion of code where the error is originating from.
$zip_name = 'dris-sweet-16-pictures.zip';
$zip = new ZipArchive();
$zip->open($zip_name, ZipArchive::CREATE);
foreach ($lg_img as $img) {
$zip->addFile(public_path().'/'.$img);
}
Response::download($zip, $zip_name, array(
'content-type' => 'application/zip',
'Content-disposition:' => 'attachment; filename=filename.zip',
'Content-Length:' => filesize($zip_name)
));
$zip->close();