Ι在jQuery中有以下代码
var method = "SaveUploadedOffer";
var url = "/Handler/UserControlHandler.ashx";
var data = { 'method': method, 'UploadedObj':
JSON.stringify(ko.toJS(Selected))};
$.post(url, data,
function (result) {
$("#preloader").css("display","block");
var obj=jQuery.parseJSON(result);
if (obj.IsSucess==true) {
self.SelectedPurpose(null);
self.SelectedPropertyType(null);
jAlert(obj.Message,"Alert...");
$("#preloader").css('display', 'none');
if(obj.Message=="Session expired, please login to continue")
{
$('#popup_ok').on('click', function(e){
window.location = "../rental/home.aspx";
});
}
else
{
$('#popup_ok').on('click', function(e){
window.location = "../user/dashboard.aspx";
});
}
}
else {
jAlert("Something went wrong, please try again later","Error...");
$("#preloader").css("display","block");
}
});
这段代码在firefox中运行正常,但在Chrome中它给了我一个错误。
请告诉我如何解决此错误。
我不知道为什么它在firefox中工作但是,当请求体大于服务器配置允许时,会发生413 errors
。
在IIS中设置uploadreadaheadsize
配置设置
以下是在uploadReadAheadSize
中设置IIS 8.5
的步骤
我已经改变了我的web.config
<configuration>
<system.web>
<!-- This will handle requests up to 20MB -->
<httpRuntime maxRequestLength="20480" timeout="3600" />
</system.web>
</configuration>
<!-- IIS Specific Targeting (noted by the system.webServer section) -->
<system.webServer>
<security>
<requestFiltering>
<!-- This will handle requests up to 20MB -->
<requestLimits maxAllowedContentLength="20971520" />
</requestFiltering>
</security>
</system.webServer>
现在它适用于firefox和chrome。谢谢