title: Handling an ASP.NET MVC FileResult returned in an (jQuery) Ajax call
body: <p><strong>Goal:</strong><br>
  I want to let my users download a file on my webpage. I want a new window to open and the file to be either displayed or downloaded there. </p>
  
  <p><strong>My implementation:</strong><br>
  This file however, first has to be generated on the server-side, which might take a while. When the user clicks the button to download the file, I do an ajax call and show a waiting animation until I get a response. The controller action that handles the call will generate the file (PDF) and return a FileResult. Now in the succes function of my ajax call back in javascript, I get the file data. </p>
  
  <p><strong>Problem:</strong> I have no Idea what I'm supposed to do with this data to get it to the user. </p>
  
  <p><strong>Workaround:</strong><br>
  Right now I use a workaround where I do not return the file in the ajax call, but store it in session. In the succes function I do <code>window.open("/controller/getPDFFromSession")</code> which will download the file. However, I prefer not to use the session for these kind of things.</p>
  
  <p>Thanks in advance.</p>