title: Download file without right click
body: <p>I have an <code>&lt;a href&gt;</code> link on a page that points to a video file (mp4). When the visitor clicks the link, the video file opens in the browser window.</p>
  
  <p>If you want to download the file, you have to "right click", and then "save link as..."</p>
  
  <p>I want that so that on a single click file will download (so that I don't have to right click).</p>
  
  <p><strong>edit:</strong> What's the problem here?</p>
  
  <pre><code>&lt;?php
      header('Content-Description: File Transfer');
      header('Content-Type: video/mp4');
      header('Content-Disposition: attachment; filename=file');
      header('Content-Transfer-Encoding: binary');
      header('Expires: 0');
      header('Cache-Control: must-revalidate');
      header('Pragma: public');
      header('Content-Length: ' . filesize($file));
      ob_clean();
      flush();
      readfile($file);
      exit;
  ?&gt;
  </code></pre>