Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $zip = new ZipArchive();
- $zip_name = time().".zip"; // Zip name
- if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE)
- {
- $error = "* Sorry ZIP creation failed at this time";
- }else{
- foreach ($_POST as $file) {
- foreach($file as $res){
- $download_file = file_get_contents($res);
- $zip->addFromString(basename($res), $download_file);
- }
- }
- $zip->close();
- }
Add Comment
Please, Sign In to add comment