title: Empty .apk when downloaded from PHP file to Android mobile device
body: <p>The code below works fine on desktop browsers (Chrome, FF), but when executed from a Android mobile (HTC Evo, Galaxy S) device the file is downloaded but empty. I've added the following line to my .htaccess file...</p>
  
  <pre><code>AddType application/vnd.android.package-archive .apk
  </code></pre>
  
  <p>... and the download works as expected if I link directly to the .apk from a HTML anchor.</p>
  
  <p>I need to provide the download via a PHP script though so that I can update database records. The following PHP method even works as expected on a blackberry device:</p>
  
  <pre><code>public function download($file)
  {
      if (!is_readable($file)) {
          return false;
      }
      header('Content-Type: application/vnd.android.package-archive');
      header('Content-Disposition: attachment; filename="test.apk"');
      header('Content-length: ' . filesize($file));
      readfile($file);
      return true;
  }
  </code></pre>