文章内容
2017/5/22 22:14:29,作 者: 黄兵
鏈樉绀洪〉闈紝鍥犱负璇锋眰瀹炰綋杩囧ぇ銆�
最近在用https的时候,上传文章,提交的时候报这样的错误:鏈樉绀洪〉闈紝鍥犱负璇锋眰瀹炰綋杩囧ぇ銆�。
翻译过来是:未显示页面,因为请求实体过大。
之后在网上找了一下资料,终于解决了问题。解决方案如下:
That is not problem of IIS but the problem of WCF. WCF by default limits messages to 65KB to avoid denial of service attack with large messages. Also if you don't use MTOM it sends byte[] to base64 encoded string (33% increase in size) => 48KB * 1,33 = 64KB
注释:这不是IIS的问题,而是WCF的问题。 WCF默认将消息限制为65KB,以避免使用大消息拒绝服务攻击。 另外如果不使用MTOM,它会将byte []发送到base64编码字符串(大小增加33%)=> 48KB * 1,33 = 64KB
To solve this issue you must reconfigure your service to accept larger messages. This issue previously fired 400 Bad Request error but in newer version WCF started to use 413 which is correct status code for this type of error.
注释:要解决此问题,您必须重新配置服务以接受较大的消息。 此问题以前触发了400错误请求错误,但是在较新版本中,WCF开始使用413,这是此类错误的正确状态代码。
You need to set maxReceivedMessageSize in your binding. You can also need to set readerQuotas.
注释:您需要在绑定中设置maxReceivedMessageSize。 您还可以设置readerQuotas。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxReceivedMessageSize="10485760">
<readerQuotas ... />
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>在iis 7.0里面做入如下修改:
单击所需要站点的名称-在“功能视图”里面双击“ASP模块”,打开“***属性”,将最后一项“最大请求实体主体***[maxRequestEntityAllowed]”改为你需要的值(例如 1073741824, 1GB)。
同时,请注意如果你上传的文件较大,请考虑一下“脚本超时[scriptTimeOut]”是否需要更改,
默认是00:01:30,yaosansi这里改成了00:05:30,当然你也可以在ASP程序里更改超时时间。
如果修改web.config文件,修改内容如下:
<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="1024" executionTimeout="60"/>
有什么问题给我在下面留言。
转载请注明出处:黄兵的个人博客 - 鏈樉绀洪〉闈紝鍥犱负璇锋眰瀹炰綋杩囧ぇ銆�
评论列表