Guest User

Untitled

a guest
May 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. //New ZIP attempt to fix unarchive error
  2.  
  3. $zipfile = new zipfile();
  4.  
  5. //Loop through directory, zip them all
  6. if($handle = opendir($zipLocation)){
  7. while(false!== ($file = readdir($handle))){
  8. if($file == '.' && $file == '..') continue;
  9. $zipfile->addFile(file_get_contents($zipLocation.'/'.$file), $file);
  10. }
  11. closedir($handle);
  12. file_put_contents($zipLocation.$zipName, $zipfile->file());
  13. }
Add Comment
Please, Sign In to add comment