Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. header('Content-Description: File Transfer');
  5. header("Content-Type: application/zip");
  6. header("Content-Transfer-Encoding: Binary");
  7. header('Content-Disposition: attachment; filename="name.zip"');
  8. header('Expires: 0');
  9. header('Cache-Control: must-revalidate');
  10. header('Pragma: public');
  11.  
  12.  
  13.  
  14.  
  15. $ua = $_SERVER['HTTP_USER_AGENT'] . "\n\n";
  16. if (strpos($ua, 'Macintosh') ==!false) {
  17.  
  18. header('Content-Length: ' . filesize('1.zip'));
  19. readfile('1.zip');
  20. // mac
  21.  
  22.  
  23. } else {
  24.  
  25.  
  26. // other
  27.  
  28. header('Content-Length: ' . filesize('2.zip'));
  29. readfile('2.zip');
  30.  
  31.  
  32. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement