title: Open FileStreamResult by ajax (as downloaded file)
body: <p>Is it possible to use an ajax call to open FileStreamResult as a downloaded file?</p>
  
  <p>Controller method</p>
  
  <pre><code>public FileStreamResult DownloadPDF()
  {
          var stream = myHandler.getFileStream("myfile.pdf");
          return File(stream, "application/pdf", "myfile.pdf"));
  }
  </code></pre>
  
  <p>Html code</p>
  
  <pre><code>&lt;a href="#" class="mydownload"&gt;Click Me&lt;/a&gt;
  &lt;script type="text/javascript&gt;
      $("a.mydownload").click(function () {
          $.ajax({
              method: 'GET',
              url: 'http://myserver/file/DownloadPDF',
              success: function (data, status, jqXHR) {
                  var blob = new Blob([data], { type: "application/pdf" })
                  var url = window.URL.createObjectURL(blob);
                  var a = document.createElement("a");
                  document.body.appendChild(a);
                  a.href = url;
                  a.click();
  
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Running on IE I get access denied, but on Chrome it runs fine. I do however get a "blank"/invalid pdf.</p>