title: How to achieve File upload using WEB API Dot net core?
body: <p>I am working on ASP DOT NET core web api where I need to send multiple attachments. I tried like following</p>
  
  <pre><code>&lt;input type="text" id="txt_firstName"  /&gt;
  &lt;input type="text" id="txt_lastName"  /&gt;
  &lt;input type="file" id="file_TicketManageMent_AttachFile" multiple  /&gt;
  &lt;input type="button" onclick="fnADD()"  /&gt;
  
  &lt;script&gt;
  function fnADD(){
    var input = document.getElementById('file_TicketManageMent_AttachFile');
    var files = fileList;
    var formData = new FormData();
  
    for (var i = 0; i != files.length; i++) {
      formData.append("files", files[i]);
    }
  
    var mdl = {};
      mdl.FirstName = 'Title';
      mdl.LastName = 'Short Description';
      mdl.Attachments = formData;
  
    $.ajax({
      cache: false,
      type: 'Post',           
      contentType: 'application/json',
      data: JSON.stringify(mdl),
      url: fnApiRequestUri('api/Customer/AddTicket'),
      success: function (xhr, ajaxOptions, thrownError) {
      }
    });
  }
  &lt;/script&gt;
  
  //C# code
  [Route("AddTicket")]
  [HttpPost]
  [Authorize(Roles = MethodsAuthorization.AllRoles)]
  public async Task&lt;IActionResult&gt; AddTicket(Model _model)
  {
  }
  
  public class Model
  {
    public string FirstName {get;set;}
    public string LastName {get;set;}
    public List&lt;IFormFile&gt; Attachments { get; set; }
  }
  </code></pre>
  
  <p>I am getting following error
   <strong><a href="https://stackoverflow.com/a/49966788/9491935">the server responded with a status of 400 ()</a></strong></p>
  
  <p>I referred following question
    <a href="https://stackoverflow.com/a/49966788/9491935">[1]: https://stackoverflow.com/a/49966788/9491935</a></p>