title: PHP AJAX Jquery - File download issue
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8357887/downloading-via-jquery-ajax-post-not-working">Downloading Via JQuery AJAX Post not working</a>  </p>
  </blockquote>
  
  
  
  <p>filedownload.php has below snippent.</p>
  
  <pre><code>$file = 'cut.png';
  header("Content-Type: image/png");
  header('Content-Disposition: attachment; filename="'.$file.'"');
  header("Content-Type: application/force-download");
  header("Content-Type: application/octet-stream");
  header("Content-Type: application/download");
  readfile($file);
  exit();
  </code></pre>
  
  <p>AJAX Call</p>
  
  <pre><code>jQuery.post('filedownload.php',{            
    'file'  :  result  // not used for the time being                    
   });
  </code></pre>
  
  <p>I make an ajax call to the <code>filedownload.php</code> file. It does not allow user to download the file. But If I run the php directly it allows user to download the file. What could be the issue ? </p>
  
  <p>I would like to use core functions rather than using jQuery Plugins. If it's not possible a plugin would be fine.</p>
  
  <p>Given that I use ajax because the page can not be refreshed. </p>