title: When input name is file[] the bind to IFormFile does not work. Dropzone + .Net Core Web API
body: <p>I'm trying to upload many files per request using dropzone and a web API using .Net Core.</p>
  
  <p>To do so, we must configure Dropzone to send many files in one request using the uploadMultiple option. By default, dropzone sends one file per request. If you are to upload 10 files, it will make 10 requests. I don't want that.</p>
  
  <p>When uploadMultiple is set to true, dropzone will append a [] to the name of the input. For instance, let's say that the name of the input is Files. When uploadMultiple is true, it becomes Files[].</p>
  
  <p>To read the files in the .Net Core Web API, we just need to create a controller that receives a IList reading from form. Like this:</p>
  
  <pre><code>public ActionResult&lt;MyResponse&gt; Upload([FromForm] IList&lt;IFormFile&gt; Files)
  </code></pre>
  
  <p><strong>The problem</strong></p>
  
  <p>The problem is the [] in the name. Dropzone sends the files under the name:</p>
  
  <p>Files[0], 
  Files[1]... File[N]</p>
  
  <p>Then the bind in the .Net Core fails because it expects the name to be File. I've tried to change the binding name to be:</p>
  
  <pre><code>public ActionResult&lt;MyResponse&gt; Upload([FromForm(Name = "Files[]")] IList&lt;IFormFile&gt; Files)
  </code></pre>
  
  <p>But this didn't work then. When I've changed to:</p>
  
  <pre><code>public ActionResult&lt;MyResponse&gt; Upload([FromForm(Name = "Files[0]")] IList&lt;IFormFile&gt; Files)
  </code></pre>
  
  <p>It worked for the first entry of the array of files.</p>
  
  <p>So what I'm looking for is a way to make the name pattern "File[any_number]" sent by Dropzone to bind in the IList of the .Net Core Web API.</p>
  
  <p>Is there any way to achieve that?</p>
  
  <p>So far, to solve this, I'm reading the files directly from the request. Like this:</p>
  
  <pre><code>var files = HttpContext.Request.Form.Files;
  </code></pre>
  
  <p>But I prefer to use the binding alternative.</p>