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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:57:39+00:00 2026-06-17T19:57:39+00:00

I know how the xtype: filefield works and I also realized that file upload

  • 0

I know how the xtype: filefield works and I also realized that file upload does not use the regular ajax method to read and write data to database…

I can set up filefield normally and when I click the browse button I can select the necessary file.

this.fp = Ext.create('Ext.form.Panel', {
           scope: this,
           width: 200,
           frame: true,
           title: 'File Upload Form',
           autoHeight: true,
           bodyStyle: 'padding: 10px 10px 0 10px;',
           items: [
           {
               xtype: 'filefield'

           }
           ],
           buttons: [
           { text: 'Upload',
               handler: function () {
                   var form = this.up('form').getForm();
                   if (form.isValid()) {
                       form.submit({
                           url: 'Upload.aspx',
                           waitMsg: 'Uploading your file...',

                           success: function (form, action) {

                               alert("OK:" + action.result.message);

                           },
                           failure: function (form, action) {
                               alert("Error:" + action.result.message);
                           }

                       });
                   }
               }
           }
           ]


       });

What happens after the upload button is clicked is the problem… How would I get the file uploaded to server side…(sql db)… using c#

I tried creating an upload.aspx page with upload.aspx.cs and did this just to see if it worked…

public partial class Upload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

    HttpContext context = HttpContext.Current;


    if (context.Request.Files.Count > 0)
    {

        BinaryReader file = new BinaryReader(context.Request.Files[0].InputStream);

        string line;
        while ((line = file.ReadString()) != null)
        {

            // sql connection?
        }

    }

    // prepare response
    MessageOb result = new MessageOb();

    result.success = true;

    result.message = "Success";


}
}

But I get this error

Ext.Error: You're trying to decode an invalid JSON String: 

Has someone documented where I can see the usual step to upload a file to sql db from extjs on client side and c# on serverside… or I’d really appreciate if someone can show me how it’s done

  • 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-17T19:57:40+00:00Added an answer on June 17, 2026 at 7:57 pm

    The problem is probably related to how you return data from the upload form submit. Ext.JS requires the response to be JSON or XML, I would verify you are not returning a html document.

    I presume MessageOb handles this somehow…maybe?

    Uncaught Ext.Error: You're trying to decode an invalid JSON String: Form Submission using Ext JS and Spring MVC

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

Sidebar

Related Questions

I've made the example in Java but I think (not tested) that it works
I know how to create a form that browses and selects a file, that's
I use the UploadFile example in EXTJS ( http://dev.sencha.com/deploy/dev/examples/form/file-upload.html ) but I don't know
I know you can not set a key value dynamically, but what about the
I know that Phonegap has an event for back button, but it's only available
I know that this sort of question has been asked here before, but still
I know there are lots of tools on the net that can make our
I know that if port 443 is open that means the remote host supports
does anyone know how to align a togglefield in Sencha Touch 2 to the
As we know that ExtJS4 is new,we will get stuck with some problems even

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.