title: When uploading files to ASP.Net 5 Web API, the collection of IFormFile is empty
body: <p>I am trying to upload some files from a console application to an ASP.NET 5 WEB API service.</p>
  
  <p>Client (console app):</p>
  
  <pre><code>    private static HttpResponseMessage UploadFiles(string[] files, Uri uploadEndpoint)
      {
          var message = new HttpRequestMessage();
          var content = new MultipartFormDataContent();
  
          foreach (var file in files)
          {
              var fs = new FileStream(file, FileMode.Open);
              var index = file.LastIndexOf(@"\");
              var fn = file.Substring(index + 1);
              fs.Position = 0;
              content.Add(new StreamContent(fs), "file", fn);
          }
  
          message.Method = HttpMethod.Post;
          message.Content = content;
          message.RequestUri = uploadEndpoint;
  
          var client = new HttpClient();
          return client.SendAsync(message).Result;
      }
  </code></pre>
  
  <p>Server (Asp.Net 5) Web API</p>
  
  <pre><code>    [HttpPost("upload")]
      public IActionResult UploadFiles(ICollection&lt;IFormFile&gt; files)
      {
          var streams = files.Select(f =&gt; f.OpenReadStream()).ToArray();
          var names = files.Select(f =&gt; ContentDispositionHeaderValue.Parse(f.ContentDisposition).FileName).ToArray();
  
          ProcessFiles(streams, names);
  
          return new HttpOkResult();
      }    
  </code></pre>
  
  <p>Unfortunately the collection of IFormFile is always empty.
  Anyone can tell me why?</p>
  
  <p>Thanks</p>
  
  <p>Manu</p>