title: Send array of files from Jquery ajax to controller action
body: <p>I am able to pass single file as System.Web.HttpPostedFileBase but when i pass same as array of files i am getting null in controller's action.</p>
  
  <p>I've tried sending array of files.</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>        &lt;input type="file" id="Attachment1"&gt;
          &lt;input type="file" id="Attachment2"&gt;
          &lt;input type="file" id="Attachment3"&gt;
          &lt;input type="file" id="Attachment4"&gt;
          &lt;input type="file" id="Attachment5"&gt;
  </code></pre>
  
  <p><strong>Javascript:</strong>  </p>
  
  <pre><code> var FileData = []; 
   $('input').each(function () {
                  var type = $(this).attr("type");
                  if (type == "file") {
                      FileData.push($(this).get(0).files[0]);
                  }
              });    
  var Data = new FormData();
  Data.append("Attachments", FileData);         
  if (url != '') {
      $.ajax({
          url: url,
          data: Data,
          type: "POST",
          contentType: false,
          processData: false,
          success: function (data) {
              alert("Saved successfully");
          }
      });
  }
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public ActionResult InsertDetails(System.Web.HttpPostedFileBase[] Attachments)
  {
     return Json(new { Success = false });
  }
  </code></pre>
  
  <p>Need to get array of files. Thanks in advance.</p>