Guest User

Untitled

a guest
Feb 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. $res = $zip->open($tempname,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE);
  4.  
  5. if ($res === TRUE) {
  6.  
  7. // add the images
  8. foreach($valid_images as $image) {
  9. $p = pathinfo($image);
  10. echo "adding: ".$image." (".filesize($image).")<br>";
  11. $zip->addFile($image,'images/'.$p['basename']);
  12. }
  13.  
  14. // add the index.html file
  15. $zip->addFromString('index.html', $file);
  16.  
  17. //close the zip
  18. $zip->close();
  19. }
  20. ?>
Add Comment
Please, Sign In to add comment