title: AJAX post multiple data after file upload
body: <p>I have this code that uploads a file with <code>$_FILES</code>:</p>
  
  <pre><code>$('input[type=file]').change(function() {
      var FilesID = $(this).attr('id');
      alert(FilesID);
      var data = new FormData();
  
      jQuery.each(jQuery("#" + FilesID)[0].files, function(i, file) {
          data.append('file-'+i, file);
      });
  
      jQuery.ajax({
          url: 'upload/index.php',
          data: data + '&amp;picid=' + FilesID,
          cache: false,
          contentType: false,
          processData: false,
          type: 'POST',
          success: function(data){
  
              $("#alertspan").text(data);
              document.getElementById("alertbox").style.display = 'block';
              setTimeout(function() {document.getElementById("alertbox").style.display = 'none';},5000);
          }
      });
  });
  </code></pre>
  
  <p>I would like to add POST data on top of the file upload, basically so that in addition to the uploaded file, you have <code>picid</code> equal to the variable <code>FileID</code>.</p>