title: Downloading PDF via PHP won't open in mobile
body: <p>Generating a PDF from wkhtmltopdf working great on desktop. 
  I have a two-step process to generate the file and then download the file.
  The file generated opens just fine on my mobile device (when I e-mail it) but using a PHP script, I am unable to open after download.</p>
  
  <p>In other words, it's not the PDF, it's the PHP download that's causing problems. The file downloads with the appropriate name, but won't open in mobile.</p>
  
  <p>Galaxy S5 w/ Chrome (up-to-date).</p>
  
  <p>The download is started with javascript:</p>
  
  <pre class="lang-js prettyprint-override"><code>window.location = 'savePDF.php?file=' + filename + '&amp;fileName=' + nameString;
  </code></pre>
  
  <p>And here's the PHP script:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  $file = $_GET['file'];
  
  header('Pragma: public',true);
  header('Expires: 0');
  header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  header("Content-Type: application/octet-stream");
  header('Content-Disposition: attachment; filename="'.$_GET['fileName'].'.pdf"');
  header("Content-Transfer-Encoding: binary");
  header('Content-Length: ' . filesize($file));
  readfile($file);
  unlink($file);
  ?&gt;
  </code></pre>
  
  <p>EDIT: <code>unlink($file)</code> added to code to show that aspect.</p>