title: How to show a PDF file in a new browser window with ajax POST and ASP.net MVC FileStreamResult?
body: <p>I have a Controller action:</p>
  
  <pre><code>public ActionResult GetReport(List&lt;int&gt; idList)
  {
      Stream stream = ReportsComponent.GetReports(idList);
      return File(stream, "application/pdf");
  }
  </code></pre>
  
  <p>To access that I have the javascript:</p>
  
  <pre><code>$.ajax({
      method: "POST",
      url: "/Reports/GetReport",
      data: { idList : idsList}
  })
  .then(function(data){
          /*Not working*/
          var blob=new Blob([data], {type: "application/pdf"});
  
          var fileURL = URL.createObjectURL(blob);
          window.open(fileURL);
          /*Not working*/
      },
      function(){
          //error
      }
  );
  </code></pre>
  
  <p>So far I am getting (with the not working code) a damaged PDF. How can I show the resultant PDF in a new browser window? </p>