title: Sending multiple files using ajax without using html form
body: <p>Im using single file input field with multiple upload property. I've already tested single file pass like that and it worked. Now I'm trying to 
  pass files using an array but there is a mistake.
  There is no form.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input id="fileInfo" name="userfile[]" type="file" multiple&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var formData = new FormData();
  var files = [];
  for(var i = 0; i &lt; length; i++) {
      files[i] = $('input', '#fileInfo')[0].files[i];
  }
  formData.append('userfile', files);
  $.ajax({
      url: "example.php",
      data: formData,
      type: 'POST',
      dataType: 'json',
      processData: false,
      contentType: false,
      success: function(res)
      {
          console.log("done");
      }
  });
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
  $length = sizeof($_FILES['userfile']['name']);
  json_encode(array($length));
  </code></pre>
  
  <p>error.log:</p>
  
  <pre><code>PHP Notice:  Undefined index: userfile in /path/to/php on line 2, referer: http://localhost/test
  </code></pre>