Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $zipname = 'yec-photos.zip';
- $zip = new ZipArchive;
- $zip->open($zipname, ZipArchive::CREATE);
- if ($handle = opendir('.')) {
- while (false !== ($entry = readdir($handle))) {
- if ($entry != "." && $entry != ".." && !strstr($entry,'.php')) {
- $zip->addFile($entry);
- }
- }
- closedir($handle);
- }
- $zip->close();
- header('Content-Type: application/zip');
- header("Content-Disposition: attachment; filename='yec-photos.zip'");
- header('Content-Length: ' . filesize($zipname));
- header("Location: yec-photos.zip");
- ?>
Add Comment
Please, Sign In to add comment