我有上传xls文件的方法
在1台计算机上一切正常,但在另一台计算机上我有错误
> 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>
我不知道什么?
P.S。我有另一种方法吗?上传图像,此方法适用于所有计算机。 实现像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);
}
});
}
}
来自控制器我返回
public ActionResult Upload(){ 返回内容(“{success:true,result:\”Файлуспешнодобавлен。\“}”); }
答案 0 :(得分:0)
ASP?这是服务器端的问题。在开发环境中的浏览器中配置服务器以显示错误。