title: Why threre is no way to download file using ajax request?
body: <p>In our application we need to implement following scenario: </p>
  
  <ol>
  <li>A request is send from client </li>
  <li>Server handles the request and generates file</li>
  <li>Server returns file in response</li>
  <li>Client browser displays file download popup dialog and allows user to download the file</li>
  </ol>
  
  <p>Our application is ajax based application, so it would be very easy and convenient for us to send ajax request (like using <code>jquery.ajax()</code> function). </p>
  
  <p>But after googilng, it turned out that file downloading is possible only when using non-ajax POST request (like described in <a href="https://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit">this popular SO thread</a>). So we needed to implement uglier and more complex solution that required building HTML structure of <code>form</code> with nested hidden fields.</p>
  
  <p>Could someone explain in simple words why is that ajax requests cannot be used to download file? What's the mechanics behind that?</p>