title: unable to send IFormFile to ASP.Net Core Web API using C# client
body: <p>I have an ASP.Net Core Web API, with a controller POST method defined like this:</p>
  
  <pre><code>[HttpPost("SubmitFile")]
  public async Task&lt;IActionResult&gt; SubmitFile(IFormFile file)
  {
  }
  </code></pre>
  
  <p>I have a client-side method to call the API SubmitFile() method, defined like this:</p>
  
  <pre><code>[HttpPost]
  public async Task&lt;IActionResult&gt; Index(ICollection&lt;IFormFile&gt; files)
  {
       using (var client = new HttpClient())
       {
           client.BaseAddress = new Uri(_options.SiteSpecificUrl);
  
           foreach (var file in files)
           {
               if (file.Length &lt;= 0)
                   continue;
  
               var fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.Trim('"');
               var fileContent = new StreamContent(file.OpenReadStream());
               fileContent.Headers.Add("X-FileName", fileName);
               fileContent.Headers.Add("X-ContentType", file.ContentType);
  
               var response = await client.PostAsync(_options.WebApiPortionOfUrl, fileContent);
           }
       }
  
      return View();
  }
  </code></pre>
  
  <p>When the client send is performed, on the server side a break-point in SubmitFile() shows that the file argument is null. How can I correctly send the file? It is important to preserve the server-side API, as I have Swashbuckle/Swagger correctly generating a UI that can send the file.</p>