Results 1 to 2 of 2

Thread: Problem with uploading file

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    12
    Vote Rating
    0
      0  

    Default Problem with uploading file

    i have method that upload xls file<br>

    on 1 computer it's all ok, but on another i have error<br>

    Code:
    Uncaught You're trying to decode an invalid JSON String: <div id="header"><h1>Server Error</h1></div>
    <div id="content">
     <div class="content-container"><fieldset>
      <h2>500 - Internal server error.</h2>
      <h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>
     </fieldset></div>
    </div>
    what i do not?

    p.s. i have another method? that upload images, this method work on all computers.
    realization like method for xls

    Code:
             if (param == 'addFile') {            var itemRs = this.getGrid().getSelectionModel().getSelection();
                var Sd = itemRs[0];
                var itemId = Sd.get('Id');
                if (form.isValid()) {
                    form.submit({
                        url: '/ServiceDemand/ServiceDemands/Upload',
                        params: {
                            itemId: itemId
                        },
                        waitMsg: TR.Config.WaitMsg,
                        success: function (form, o) {
                            win.close();
                            TR.Globals.showInfo(o.result.msg);
                            me.doRefreshFiles();
                        },
                        failure: function (form, o) {
                            TR.Globals.showError(o.result.msg);
                        }
                    });
                }
            }else if (param == 'import') {
                if (form.isValid()) {
                    form.submit({
                        url: '/ServiceDemand/ServiceDemands/Import',
                        waitMsg: TR.Config.WaitMsg,
                        success: function (form, o) {
                            win.close();
                            console.log(o.result.result);
                            TR.Globals.showInfo(o.result.result);
                            me.getGrid().store.load();
                            
                        }
                        ,failure: function (form, o) {
                            TR.Globals.showError(o.result.result);
                        }
                    });
                }
            }
    from controller i return
    Code:
    public ActionResult Upload()        {
               
                return Content("{success:true, result:\"???? ??????? ????????.\"}");
            }

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    The form expects JSON in return, you are returning HTML.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •