Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `//Creating zip
- $zip = new ZipArchive();
- $zip->open($zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE);
- $zip->addFile('/ramesh/work/31_receipt_cert.txt','31_receipt_cert.txt');
- $zip->addFile('/ramesh/work/31_aadhaar.png','31_aadhaar.png');
- $zip->close();
- //Downloading zip
- header('Content-Description: File Transfer');
- header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename='.basename($zip_file));
- header('Content-Transfer-Encoding: binary');
- header('Expires: 0');
- header('Cache-Control: must-revalidate');
- header('Pragma: public');
- header('Content-Length: ' . filesize($zip_file));
- readfile($zip_file);
- `
Add Comment
Please, Sign In to add comment