PDA

View Full Version : Problem with uploading file



Unkind
7 Feb 2013, 2:23 AM
i have method that upload xls file<br>

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


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


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

public ActionResult Upload() {

return Content("{success:true, result:\"???? ??????? ????????.\"}");
}

mitchellsimoens
9 Feb 2013, 1:21 PM
The form expects JSON in return, you are returning HTML.