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 8787133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:48:35+00:00 2026-06-13T21:48:35+00:00

Can`t really understand where is a mistake.. I have a form with fileuploadfield. Request

  • 0

Can`t really understand where is a mistake..

I have a form with fileuploadfield. Request is sended good, action on my controller gets all params, works with them, and sends response to browser. But in html page, after submiting the form, always fires FAILURE event, and never SUCCESS.

Client Side Code

Ext.create('Ext.form.Panel', {
        renderTo: 'Container',
        bodyPadding: '10 10 0',
        items: [
        {
            xtype: 'form',
            width: 300,
            border: false,
            fileUpload: true,
            items: [
            {
                xtype: 'combobox',
                id: 'PayTypes',
                width: 215,
                store: PayTypesStore,
                valueField: 'id',
                displayField: 'Name',
                editable: false,
                name: 'id'
            }
            ,
            {
                xtype: 'filefield',
                id: 'form-file',
                name: 'file',
                buttonText: '',
                buttonConfig: {
                    iconCls: 'upload-icon'
                }
            }
            ],
            buttons: [
            {
                text: 'Send',
                handler: function () {
                    var form = this.up('form').getForm();
                    if (form.isValid()) {
                        form.submit({
                            url: 'UploadFile',
                            waitMsg: 'Uploading your photo...',
                            success: function (fp, o) {
                                console.log("success");
                                msg('Success', 'Processed file on the server');
                            },
                            failure: function (form, action) {
                                console.log(action);
                                Ext.Msg.alert('Failed', action.result ? action.result.message : 'No response');
                            }
                        });
                    }
                }
            }
            ]
        }
        ]
    });

Server Side Code:

public JsonResult UploadFile(HttpPostedFileWrapper file, int id)
    {
        var response = Json(new { success = true });
        response.ContentType = "text/html";

        return Json(response);
    }

Response, recieved on the client side:

{"ContentEncoding":null,"ContentType":"text/html","Data":"success":true},"JsonRequestBehavior":1,"MaxJsonLength":null,"RecursionLimit":null}

What i need to fix in my code to get SUCCESS event after sumniting form?

  • 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-13T21:48:36+00:00Added an answer on June 13, 2026 at 9:48 pm

    You called Json method twice. The only thing you need is

    public JsonResult UploadFile(HttpPostedFileWrapper file, int id)
    {
        return Json(new { success = true });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't really understand this concept. Assuming i have this interface: public interface IValidate
I'm a new to Prototype and I can't really understand the minimalist documentation provided
really can't understand, how to build correctly project that uses boost.python. I've included boost_(python/thread/system)-mt.
I really can't understand how the below piece of code is working... options.each {
I try to parse encrypted &RQ history, but i really can't understand asm code.
I'm trying to understand amazon php sdk for AWS but I really can't use
I am struggling really hard to understand this behavior so maybe someone can shed
This is something weird I can't really understand, I'm working in PostGreSql9.2 ... I
I see a few questions about this here, but I can't really understand what
Can't really understand what's going wrong here? It's just a simple exception with an

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.