Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $res = $zip->open($tempname,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE);
- if ($res === TRUE) {
- // add the images
- foreach($valid_images as $image) {
- $p = pathinfo($image);
- echo "adding: ".$image." (".filesize($image).")<br>";
- $zip->addFile($image,'images/'.$p['basename']);
- }
- // add the index.html file
- $zip->addFromString('index.html', $file);
- //close the zip
- $zip->close();
- }
- ?>
Add Comment
Please, Sign In to add comment