Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:25:33+00:00 2026-06-07T15:25:33+00:00

I’m tring to post file to server using Extjs4.1 filefield. but an error occur,

  • 0

I’m tring to post file to server using Extjs4.1 filefield.

but an error occur, it say result is undefined. 🙁

enter image description here

In form,

without filefield, it works fine.’

This is the form. and it load OK. the error occur when try to submit.

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: '<b>Order Number </b>',
                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: '<b>Refundable Tax Amount </b>',
        name: 'refundAmount',
        readOnly: true,
        labelWidth: 160,
        anchor: '45%',
        allowBlank: false
    }, {
        fieldLabel: '<b>Certificate File</b>',  //without this, it's OK
        xtype : 'filefield',  
        name: 'certificate',
        labelWidth: 160,
        anchor: '90%',
        allowBlank: false
    }
    .
    .
    .

This is my controller (to submit form),

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
                    });
                }
            });
        }
    }

Anybody know, what is my problem? please advice me~!

Thanks

[EDIT]

when submit(), after 5-10 sec, the error message occur.

enter image description here

enter image description here

[Edit2]

ASP.NET (c#) 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);
}

yes, I think the asp.net code is wrong… anybody know what’s the problem with that code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:25:35+00:00Added an answer on June 7, 2026 at 3:25 pm

    If the server is using JSON to send the return object, then the Content-Type header must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.

    C# (MVC3) code:

    var jsonResponse = Json( new
                            {
                                success = false,
                                message = "Oops. There was an unexpected error.\n" + ex.ToString()
                            });
    jsonResponse.ContentType = "text/html"; // <-- Set content type explicitly.
    return jsonResponse;   
    

    Here is the link to documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.