title: Unable to download excel file from Angular 8 and server side code is .net core webapi 3.1
body: <p>sorry for duplicate issue but none of existed solutions haven't resolved my issue.</p>
  <p>when trying to download excel file from Angular8,getting below error.</p>
  <p><a href="https://i.stack.imgur.com/jmSet.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jmSet.jpg" alt="enter image description here" /></a></p>
  <p>i'm implemented method which is return file by using .net core web api 3.1.below is the method which is return excel file.</p>
  <pre><code> [Route(&quot;downloadClaims&quot;)]
      [HttpGet]
      public FileResult DownloadClaims(int userId)
      {
        var memory = new MemoryStream();
          using (var stream = new FileStream(&quot;E:/AddClaim.xlsx&quot;, FileMode.Open))
          {
              stream.CopyTo(memory);
          }
          memory.Position = 0;
  
          var mimeType = &quot;application/vnd.ms-excel&quot;;
  
          return File(memory, mimeType, &quot;AddClaim.xlsx&quot;);
      }
  </code></pre>
  <p>handling download functionality in Angular8. please find below code my angular service.</p>
  <pre><code> downLoadAllClaims():Observable&lt;Blob&gt;
           {
          let httpOption = {
            headers: new HttpHeaders({
              'Content-Type': 'application/json',
              'responseType': 'blob' as 'json',
              'Access-Control-Expose-Headers':'Content-Disposition'
              , 'observe': 'response'
            })
          }
            return this.http.get&lt;Blob&gt;(baseURL+'/downloadClaims',httpOption);
         }
  </code></pre>
  <p>and my component code is as below.</p>
  <pre><code> downLoadClaim(_evnt):void{
  this.claimService.downLoadAllClaims().subscribe(
    blob =&gt; {
      saveAs(blob,&quot;AllClaims.xlsx&quot;)
    },
    error =&gt; {
      console.log(&quot;Something went wrong while downloading&quot;);
    });
  </code></pre>
  <p>}</p>
  <p>file is not getting downloading.not understanding what did i miss?</p>