title: JQuery Ajax Form with File Upload not working in IE
body: <p>I'm using Jquery Ajax Form to upload files, which works well in Chrome and Firefox, but it doesnt work in IE. It pop ups a window telling me to save the file that I'm trying to upload.</p>
  
  <p>Some example of my code, if necessary, is rite here:
  HTML:</p>
  
  <pre><code>&lt;div class="addNewDocumentContent"&gt;
  &lt;form id="AddNewDocForm" action="@Url.Action("AddNewDocument", "BidForm")" enctype="multipart/form-data" method="post"&gt;
  &lt;div&gt;
      &lt;input name="File" type="file" style="width: 80%;" /&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;label&gt;
          @Labels.Name&lt;/label&gt;
      &lt;input type="text" name="Name" style="width: 80%;" /&gt;
  &lt;/div&gt;
  &lt;div style="text-align: right;"&gt;
      &lt;button type="button" name="Back" value="Back"&gt;
         @Buttons.GoBack
      &lt;/button&gt;
      &lt;button type="submit" name="Add" value="Back"&gt;
          @Buttons.Add
      &lt;/button&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>
  JS:</p>
  
  <pre><code>//Document Ready=============================================================================
  $(function () { 
  
      $('#AddNewDocForm').ajaxForm({
          type: 'POST',
          beforeSubmit: function () {
              return $("#AddNewDocForm").valid();
          },
          success: function (documents) {
              FillDocuments(documents);
              $('#dialogAddNewDocument').dialog('close');
          }
      });
  });
  //Validate====================================================================================
  //Validation=====================================================================================
  $(function () {
      $("#AddNewDocForm").validate({
          ignore: ":not(:visible)",
          rules: {
              File: "required",
              Name: "required"
          }
      });
  });
  //=========================================================================================
  </code></pre>
  
  <p>Action</p>
  
  <pre><code>[HttpPost]
      public JsonResult AddNewDocument(DocumentModel document)
      {
          if (ModelState.IsValid)
          {
              List&lt;DocumentModel&gt; documents = null;
              if (Session["Documents"] != null)
              {
                  documents = (List&lt;DocumentModel&gt;)Session["Documents"];
                  var doc = documents.OrderByDescending(x =&gt; x.Number).Take(1).FirstOrDefault();
  
                  document.Number = doc != null ? doc.Number + 1 : 1;
                  document.FileName = document.File != null ? document.File.FileName : document.FileName;
                  documents.Add(document);
              }
              else
              {
                  documents = new List&lt;DocumentModel&gt;();
                  document.Number = 1;
                  document.FileName = document.File != null ? document.File.FileName : document.FileName;
                  documents.Add(document);
                  Session["Documents"] = documents;
              }
  
              var displaydocs = documents.Select(x =&gt; new
              {
                  Name = x.Name,
                  Number = x.Number,
                  File = x.File != null ? x.File.FileName : x.FileName,
                  Route = x.Route != null ? x.Route : "#",
              });
  
              return Json(displaydocs, JsonRequestBehavior.AllowGet);
          }
          else
          {
              return null;
          }
      }
  </code></pre>
  
  <p>and finally model:</p>
  
  <pre><code>  public class DocumentModel
  {
      public int Number { get; set; }
      [Required]
      public string Name { get; set; }
      [Required]
      public HttpPostedFileBase File { get; set; }
  
      public string FileName { get; set; }
      public string Route { get; set; }
  }
  </code></pre>
  
  <p>Again, it works in every browser except IE8. Im probably not the only one, but I havent found an answer out there.</p>