title: Post HTML Form with File Upload and stay on same page (jQuery)
body: <p>I'm using jQuery and PHP to post a long dynamically created HTML Form.  Since I need to have a "Sending" dialog and show the results on the same page (ideally in a jQuery popup), I do not use the traditional HTML form submit.  What I'm doing works great except that File input types do not upload.  </p>
  
  <p>Is there a way to do this?</p>
  
  <p>Here is my code:</p>
  
  <p>jQuery:</p>
  
  <pre><code>    function submitForm(submiturl)
      {
          $.blockUI({ message: "&lt;h2&gt;Submitting...&lt;/h2&gt;" }); 
  
          var form = $('#theForm').serialize();
          var fields = "&lt;?= urlencode(serialize($allFields)) ?&gt;";
  
          $.ajax({ 
              url: submiturl,
              data: {form: form, fields: fields, extraResults: window.extraResults},
              type: "post", 
              cache: false, 
              complete: function() { 
                  // unblock when remote call returns 
                  $.unblockUI(); 
              }, 
              error: function (xhr, ajaxOptions, thrownError) {
                  alert("ERROR");
  
              },
              success: function( strData ){
                  alert("SUCCESS:  " + strData);
  
              }
  
          }); 
      }
  </code></pre>