Guest User

Untitled

a guest
Mar 24th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. $zip = new ZipArchive();
  2. $zip_name = time().".zip"; // Zip name
  3. if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE)
  4. {
  5. $error = "* Sorry ZIP creation failed at this time";
  6. }else{
  7. foreach ($_POST as $file) {
  8. foreach($file as $res){
  9. $download_file = file_get_contents($res);
  10. $zip->addFromString(basename($res), $download_file);
  11. }
  12. }
  13. $zip->close();
  14. }
Add Comment
Please, Sign In to add comment