Guest User

Untitled

a guest
Jun 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. `//Creating zip
  2. $zip = new ZipArchive();
  3. $zip->open($zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE);
  4. $zip->addFile('/ramesh/work/31_receipt_cert.txt','31_receipt_cert.txt');
  5. $zip->addFile('/ramesh/work/31_aadhaar.png','31_aadhaar.png');
  6. $zip->close();
  7. //Downloading zip
  8. header('Content-Description: File Transfer');
  9. header('Content-Type: application/octet-stream');
  10. header('Content-Disposition: attachment; filename='.basename($zip_file));
  11. header('Content-Transfer-Encoding: binary');
  12. header('Expires: 0');
  13. header('Cache-Control: must-revalidate');
  14. header('Pragma: public');
  15. header('Content-Length: ' . filesize($zip_file));
  16. readfile($zip_file);
  17. `
Add Comment
Please, Sign In to add comment