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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -