title: force download of msi file
body: <p>I must be having a dense day. I can't seem to figure this out.</p>
  
  <p>I have a page on my website which should force the download of the msi file, but I want to leave the page's html shown with download instructions.</p>
  
  <p>So far, I have tried the following tag in the html (note I only have access to the body of this page)</p>
  
  <pre><code>&lt;meta http-equiv="Refresh" content="0; URL=file.msi"&gt;
  </code></pre>
  
  <p>however in firefox this showed the binary file as garbled text.</p>
  
  <p>Next I tried the following php inserted</p>
  
  <pre><code>$file = "file.msi";
  header('Content-Description: File Transfer');
  header('Content-Type: application/octet-stream');
  header('Content-Disposition: attachment; filename='.basename($file));
  header('Content-Transfer-Encoding: binary');
  header('Expires: 5');
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  header('Pragma: public');
  header('Content-Length: ' . filesize($file));
  ob_clean();
  flush();
  readfile($file);
  exit;
  </code></pre>
  
  <p>However this closed the tab/window and not leaving the install instructions.</p>
  
  <p>finally, I tried the following back in the html:</p>
  
  <pre><code>&lt;META HTTP-EQUIV="Content-Type" CONTENT="application/octet-stream"&gt; 
  &lt;meta http-equiv="content-disposition" content="attachment; filename=file.msi" /&gt;
  </code></pre>
  
  <p>But this refuses to download the file.
  Any pointers greatly appreciated.</p>