title: Extjs4, File uplaod
body: <p>I'm tring to post file to server using Extjs4.1 filefield.</p>
  
  <p>but an error occur,  it say result is undefined. :(</p>
  
  <p><img src="https://i.stack.imgur.com/ma516.png" alt="enter image description here"></p>
  
  <p>In form,</p>
  
  <p>without filefield, it works fine.'</p>
  
  <p>This is the form. and it load OK. the error occur when try to submit.</p>
  
  <pre><code>var myform = Ext.create('Ext.form.Panel', {
      bodyStyle: 'padding: 15px 50px',
      defaults: {
          xtype: 'textfield',
          anchor: '100%',
          style : 'margin-top:10px'
      },
      items: [
      {
          xtype: 'fieldcontainer',
          layout: 'hbox',
          anchor: '50%',
          items: [
              {
                  xtype: 'textfield',
                  fieldLabel: '&lt;b&gt;Order Number &lt;/b&gt;',
                  name: 'orderNo',
                  maxLength: 9,
                  flex: 1,
                  allowBlank: false
              }, {
                  xtype: 'button',
                  text: 'Get Info',
                  name : 'getOrderInfo_btn',
                  tooltip: 'Get Order Information',
                  style: 'margin-left:5px',
                  flex: 0
              }
          ]
      }, {
          fieldLabel: '&lt;b&gt;Refundable Tax Amount &lt;/b&gt;',
          name: 'refundAmount',
          readOnly: true,
          labelWidth: 160,
          anchor: '45%',
          allowBlank: false
      }, {
          fieldLabel: '&lt;b&gt;Certificate File&lt;/b&gt;',  //without this, it's OK
          xtype : 'filefield',  
          name: 'certificate',
          labelWidth: 160,
          anchor: '90%',
          allowBlank: false
      }
      .
      .
      .
  </code></pre>
  
  <p>This is my controller (to submit form),</p>
  
  <pre><code>refundTaxAmount: function (obj) {
          var form = obj.up('panel').down('form').getForm();
          console.log('Hi'); // it prints, but after that it stop with an error msg.
          if (form.isValid()) {
              form.submit({
                  waitMsg: 'Please wait, now processing...',
                  url: '/Order/CreditForTax/',
                  method: 'POST',
                  success: function (form, action) {
                      Ext.MessageBox.show({
                          title: 'Notice',
                          msg: 'The tax credit has been refunded!',
                          buttons: Ext.MessageBox.OK,
                          icon: Ext.MessageBox.INFO,
                          width: 300
                      });
                      form.reset();
                  },
                  failure: function (form, action) {
                      Ext.MessageBox.show({
                          title: 'Error',
                          msg: action.result.message,
                          buttons: Ext.MessageBox.OK,
                          icon: Ext.MessageBox.ERROR,
                          width: 300
                      });
                  }
              });
          }
      }
  </code></pre>
  
  <p>Anybody know, what is my problem? please advice me~!</p>
  
  <p>Thanks</p>
  
  <p>[EDIT]</p>
  
  <p>when submit(), after 5-10 sec, the error message occur.</p>
  
  <p><img src="https://i.stack.imgur.com/Y7psQ.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/dbZZK.png" alt="enter image description here"></p>
  
  <p>[Edit2]</p>
  
  <p>ASP.NET (c#) Code,</p>
  
  <pre><code>[HttpPost]
  public JsonResult CreditForTax(RefundModel info, HttpPostedFileBase certificate)
  {
      object result;
      try
      {
      //do something
  
      result = new {success = true};
      }
      catch (Exception e)
      {
      log.Error(e.Message +"\n"+e.StackTrace);
      result = new { success = false, message = e.Message };
      }
  
      return Json(result);
  }
  </code></pre>
  
  <p>yes, I think the asp.net code is wrong... anybody know what's the problem with that code?</p>