Create a zip in specific Folder PHP -
i want create zip in specific directory. can create folder code:
function createzip($array) { $files = $array; $zipname = 'ftpack.zip'; $zip = new ziparchive; $zip->open($zipname, ziparchive::create); print_r($array); foreach ($files $file) { $zip->addfile($file); } $zip->close(); }
but code create zip in principal directory, want create in @ /zipdownload directory.
just pass full path:
$zipname = '/path/to/ftpack.zip';
also make sure folder /path/to
writable php.
Comments
Post a Comment