title: PHP: Download file script not working on iPad
body: <p>I have a file download script that I have written, which reads files from below public_html and allows the user to download them after checking to see if the user is logged in and that the file is a valid file for them to download.</p>
  
  <p>An issue I've recently come across is that on an iPad it just fails to do anything when the link is clicked.</p>
  
  <p>Example download file code after all the checks have been done:</p>
  
  <pre><code>header("Pragma: public");
  header("Expires: 0");
  header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  header("Cache-Control: private",false);
  header("Content-Type: application/msword");
  header("Content-Disposition: attachment; filename=\"file.doc\";" );
  header("Content-Length: 50688");
  
  readfile(SITE_PATH .'/files/file.doc');
  </code></pre>
  
  <p>This script has been tested and checked on PC, Mac and Linux machines in multiple browsers (FF, Opera, IE6-9, Chrome, Safari) and all seem to work fine, so it must be something that the iPad does differently.</p>
  
  <p>I'd imagine it's something to do with the iPad not actually having a file structure as such to download files to, but I'm not certain.</p>
  
  <p>Has anyone come across this problem before? If so, is there a fix?</p>