title: Why success callback is not called in extjs form submission?
body: <p>I'm trying to upload a file using Ext JS forms and in case of success or failure, show appropriate messages. But I'm not able to get the desired result. I'm not able to make <code>success</code> or <code>failure</code> callbacks work in <code>form.submit</code> action. </p>
  
  <p>What I've done till now is:</p>
  
  <p>Creating a form with this script:</p>
  
  <pre><code>new Ext.FormPanel({
      fileUpload: true,
      frame: true,
      url: '/profiler/certificate/update',
      success: function() {
          console.log(arguments);
      },
      failure: function() {
          console.log(arguments);
      }
  }).getForm().submit()
  
  
  ​/*
      The response Content-Type is text/html (with charcode=utf8);
      The response JSON is: { "success": true }
  */​​
  </code></pre>
  
  <p>Setting the response <code>Content-Type</code> to <code>text/html</code> based on <a href="https://stackoverflow.com/a/6227369/811785">this answer</a>.<br>
  Sending an appropriate JSON result back, based on <a href="http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.action.Submit" rel="nofollow noreferrer">Ext JS docs</a>. The response captured via Fiddler is:</p>
  
  <pre><code>{"success":false}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{"success":true}
  </code></pre>
  
  <p>I even set the response Content-Type to <code>application/json</code>. But still no success.</p>
  
  <p>I've read links like <a href="http://www.sencha.com/forum/showthread.php?111794-Success-handler-not-getting-called-in-file-upload-using-extjs" rel="nofollow noreferrer">this</a> and <a href="https://stackoverflow.com/questions/8053690/extjsdjango-form-submit-success-failure-issue">this</a>, but none of them helped. Please note that I also tried another script which creates a form, with an upload field in it, and a save button, and I submitted the form in the handler of the save button. But still no callback is fired. </p>