title: How to I get C# FileContentResult response in Javascript?
body: <p>I have a C# Web API which returns <code>FileContentResult</code>. Here is my code</p>
  <pre><code> [HttpGet]
      [Route(&quot;Download&quot;)]
      public async Task&lt;ActionResult&lt;DownloadResponse&gt;&gt; DownloadFiles(int fileDocumentId)
      {
              var file = ... ; // code removed for brevity
              return File(file.FileData , file.FileType, file.FileName);
      }
  
  public class DownloadResponse
  {
      public string FileType { get; set; }
      public byte[] FileData { get; set; }
      public string FileName { get; set; }
  }
  </code></pre>
  <p>and my front-end Javascript, I managed to call the web API and able to get the response.</p>
  <pre><code>function download(id) {
      fetch(`https://localhost:xxx/api/file/download?fileDocumentId=11`)
          .then(response =&gt; {
              return response
          })
          .then(result =&gt; {
              console.log(result);                
          })
          .catch(function (error) {
              console.log('Request failed', error)
          });
  }
  </code></pre>
  <p>When I <code>console.log(result);</code>, there are a lot of properties. Which property has the response data so that I can see the <code>FileData</code> and <code>FileName</code> data?</p>
  <p><a href="https://i.stack.imgur.com/c39ux.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c39ux.png" alt="enter image description here" /></a></p>