title: Upload a file using Angular 6 to Web Api C#
body: <p>I have Angular CLI application and Dot net core 2.0 Web API. which I need to upload the file from Angular to Web API. from Web API to Server. When I use Http its working fine. When using HttpClient, it's not working.
  Here is my component.ts code:</p>
  
  <pre><code>fileChange(event, grdvalue) {
  debugger;
  let fileList: FileList = event.target.files;
  if (fileList.length &gt; 0) {
    let file: File = fileList[0];
    const formData: FormData = new FormData();
    let GridName = grdvalue;
  
    formData.append('file', file, file.name);
    formData.append('Id', this.userId);
    formData.append('GridValue', GridName)
  
    this.myService.PostFileToAzure(formData).subscribe(details =&gt; {
      debugger;
    },
      (error) =&gt; {
        debugger;
      })
    }
   }
  </code></pre>
  
  <p>here is My Service Code:</p>
  
  <pre><code> PostFileToAzure(form) {
      debugger;
      var body = JSON.stringify(form);
      return this.http.post(this.baseApiURL + '/Interpretation/InterpreterFileUpload', form);
  }
  </code></pre>
  
  <p>Here is my Web API code:</p>
  
  <pre><code>[HttpPost("InterpreterFileUpload")]
      public async Task&lt;IActionResult&gt; InterpreterFileUpload()
      {
          try
          {
  
              var file = Request.Form.Files[0];
              HttpRequest formData = HttpContext.Request;
          }
      }
  </code></pre>
  
  <p>How to do send the file using HttpClient From Angular to Web API. Am getting an error in web API like 'Incorrect Content-Type: application/json'</p>