title: jquery Chunked Fileupload: Handle Server Side Error
body: <p>I'm trying to get the error handling to work for chunked file upload using blueimps jquery fileupload.</p>
  
  <p>I have the following code, in which when a server side error occures, the error method never gets hit:</p>
  
  <pre><code>    $('#fileupload').fileupload({
          dataType: 'json',
          maxFileSize: 50 * 1000 * 1000 * 1000,
          maxChunkSize: 5 * 1024 * 1024,
          singleFileUploads: true,
          sequentialUploads: true,
          add: function (e, data) {
  
              var jqXHR = data.submit()
                  .success(function (result, textStatus, jqXHR) {
                      debugger;
                      var url = "/Upload.ashx?SetId=@Model.SetId&amp;filename=" + result[0].name + "&amp;ct=" + result[0].type + "&amp;multiUpload=complete";
                      url = encodeURI(url);
                      $.ajax(url);
                  })
                  .error(function (jqXHR, textStatus, errorThrown) {
                      alert(textStatus);
                  })
                  .complete(function (result, textStatus, jqXHR) {
                      //alert("complete");
                  });
          }
  
      });
  </code></pre>
  
  <p>Neither when I return json like  {"error","Error with the extension of the file"} with an Http 200 response, nor a http 500, make the code hit the above error method.</p>