title: Ajax File upload - not working in IE
body: <p>I have an ajax image upload on my site which isn't working in IE. The first problem I noticed is that the "FormData" type was undefined in IE. I came across the workaround I'm using in the ajax call below. However, the ajax call is only returning the error function when clicking upload, never hitting my controller action "UpdateAvatar". Works perfect in every other browser. Does anyone have any experience with this?</p>
  
  <pre><code>&lt;div class="modal-body"&gt;
      &lt;input type="file" name="UploadFile" id="uploadfile"&gt;
  &lt;/div&gt;
  
  &lt;div class="modal-footer"&gt;
      &lt;button type="button" class="btn btn-primary" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
      &lt;button type="button" id="updateAvatarBtn" class="btn-success btn"&gt;Upload&lt;/button&gt;
  &lt;/div&gt;
  
  $('#updateAvatarBtn').click(function (event) {
      var file = $('#uploadfile').get(0).files;
  
      if (typeof FormData == "undefined") {
          var data = [];
          data.push('data', JSON.stringify(file));
      }
      else {
          var data = new FormData();
          data.append("file", file[0]);
      }
      $.ajax({
          url: 'AccountSetup/updateAvatar',
          type: 'POST',
          contentType: false,
          processData: false,
          data: data,
          success: function (response) {
              $('#imgPreview').attr("src", response);
              $('#uploadImageModal').modal('hide');
              toastr.success('Image Upload Successful');
          },
          error: function () {
              toastr.error('Image Upload Unsuccessful. Please try again.');
          }
      })
  })    
  </code></pre>