title: Send input files data with ajax
body: <p><strong>html markup:</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input id="fileSelect" type="file" id="file" name="files[]" multiple="multiple" accept="image/*" /&gt;
  </code></pre>
  
  <p>I am uploading multiples files with php. I want to make an array of upload files and send to server with ajax. how to make an array of the multiple selected files?</p>
  
  <p><strong>JavaScript:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>jQuery.ajax({
      url: 'insertfiles.php',
      type: "POST",
      data: {
        file: // array of selected files.
      },
      success: function(data){
      },
      error: function(data){
        alert( 'Sorry.' );
      }
  });
  </code></pre>