title: Receiving arrays in asp.net core web api form axios.post
body: <p>For example I have this code, that sends data to the asp.net core 6 web api controller.</p>
  <pre><code>const formData = new FormData();
  formData.append(&quot;Id&quot;, 1);
  formData.append(&quot;PhotoNames&quot;, [&quot;name1&quot;, &quot;name2&quot;, &quot;name3&quot;]);
  formData.append(&quot;Photos&quot;, [file1, file2, file3)];
  axios.post(&quot;/api/MyController&quot;, formData);
  </code></pre>
  <p><code>file1, file2, file3</code> are the photos, which I received form <code>&lt;input type=&quot;file&quot;/&gt;</code>.</p>
  <p>I handled the same request, but without arrays, by using this code in <code>MyController.cs</code>:</p>
  <pre><code>public class Item
  {
      public int Id { get; set; }
      public string PhotoName{ get; set; }
      public IFormFile Photo { get; set; }
  }
  
  [HttpPost]
  public IActionResult Post([FromForm] ImageModel file)
  {
     //Using all the data from the request here   
  }
  </code></pre>
  <p>The request looked like:</p>
  <pre><code>const formData = new FormData();
  formData.append(&quot;Id&quot;, 1);
  formData.append(&quot;PhotoName&quot;, &quot;name1&quot;);
  formData.append(&quot;Photo&quot;, file1);
  axios.post(&quot;/api/MyController&quot;, formData);
  </code></pre>
  <p>How can I handle post request with arrays in it? What kind of class and function I need to use in <code>MyController.cs</code>?</p>