title: PHP: Download a file on button click?
body: <p>I created a form, which, when a contained button is clicked, should open a download dialog to download a certain file. The file is placed on the same server.</p>
  
  <p>I tried:</p>
  
  <pre><code>header("Content-Type: application/force-download");
  header("Content-Disposition: attachment; filename=" . $file . '"'); 
  </code></pre>
  
  <p>Where $file is a local path + the file name, for example c:\mypath\myfile.xls. This does not work though. It offers me a file, but its not a valid file. How else could I do that? </p>
  
  <p>Note: I wrote c:\ because its still on my local machine for testing.</p>
  
  <p>Thanks! </p>