title: Post `<input type='file' />` array
body: <p>I have an <code>&lt;input type='file' /&gt;</code> array of attachments that I post to an API, but I'm getting the <code>files</code> array param empty, what am I missing? Am I declaring the correct type (<code>IEnumerable&lt;IFormFileCollection&gt; files</code>) on the api? </p>
  
  <p>The query string parameters are passing fine.</p>
  
  <pre><code>const  attachments  = Array.from(fileList);
  
  const files = attachments;
  
  const result = await apiPost(`api/attachments/addAttachments?request=${request}&amp;&amp;ticketId=${ticketId}`, files, {
        headers: { 'Content-Type': 'multipart/form-data' },
      });
  </code></pre>
  
  <p>And the API:</p>
  
  <pre><code>[HttpPost]
  [Route("attachments")]
  public async Task&lt;string&gt; addAttachments(string request, int ticketId, [FromBody]IEnumerable&lt;IFormFileCollection&gt; files)
  {...}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UYBun.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UYBun.png" alt="enter image description here"></a></p>
  
  <p><code>apiPost</code>:</p>
  
  <pre><code>import { AdalConfig, adalFetch } from 'react-adal';
  
  export const apiFetch: &lt;T&gt;(url: string, options?: object) =&gt; Promise&lt;T&gt; = (
    url: string,
    options: object,
  ) =&gt; adalFetch(authContext, adalConfig.endpoints.api, axios, url, options);
  
  export const apiPost = async &lt;T&gt;(url: string, data: object): Promise&lt;T&gt; =&gt; {
    const options = {
      method: 'post',
      data,
      config: {
        headers: {
          'Content-Type': 'application/json',
        },
      },
    };
    return apiFetch(url, options);
  };
  </code></pre>