title: Unable to post files using ajax post
body: <p>We use ASP.Net Mvc 4.0.</p>
  
  <p>My objecctive is to save a form with both normal input fields as well as file input fields.
  I should be able to add extra data while posting.
  I should be able to do perform few actions on 'Ajax Post's Success.</p>
  
  <p>We used ajax post to post the form data as we could accomplish above 2, but failed in serializing and posting of files to server.</p>
  
  <p>Whenever we post using ajax post, always Request.Files.Count == 0, when i check in my controller's Post Action.</p>
  
  <p>ajax post i have used is:</p>
  
  <pre>
  
          function PostData(formId, eventSource, eventName, eventArgs, controlId) {
     var $dialogForm = $("#" + formId + "Form");
  
     fdata = $dialogForm.serialize();
     fdata = fdata + '&eventSource=' + eventSource + "&eventName=" + eventName + '&eventArgs=' + eventArgs;
  
      $.ajax({
          url: $dialogForm.attr("action"),
          type: $dialogForm.attr("method"),
          cache: false,
          data: fdata,
          success: function (result) {
              ProcessEvent(result);
          }
      });
  }
  
  
  </pre>
  
  <p>Please provide me a solution for this!</p>