title: $_FILES and $_POST using ajax
body: <p>in my form, I added input file.  </p>
  
  <pre><code>&lt;input name="uploadedFile" type="file" size="50" accept="application/pdf" /&gt;
  </code></pre>
  
  <p>And I have this ajax: </p>
  
  <pre><code>$("#submit").click(function() {
    $.ajax({
      type: "POST",
      url: "submit.php",
      data: $("form").serialize(),
      success: function(result){
         alert(result);
      });
      return false;
  });
  </code></pre>
  
  <p>How can I pass the file data to submit.php and upload it using the code in submit.php.  Thanks. </p>