我在IIS中托管了asp.net web api应用程序。这个应用程序有 100mb和. 但有时客户会响应非常小的请求。我看到了一些修复,例如“只需更改 uploadreadaheadsize”。但实际上对我来说这个解决方案并不清楚。为什么在正确配置请求限制时会遇到此错误?更新 1:更多细节 - 此应用程序使用客户端证书身份验证。更新 2:我发现了这个https://technet.microsoft.com/en-us/library/cc737382(v=ws.10).aspx<httpRuntime maxRequestLength=...
<requestLimits maxAllowedContentLength=...
413 Request entity too large
问问题
3391 次
1 回答
1
在这里您可以找到此问题的原因说明。我将uploadreadaheadsize设置为1 mb而不是默认的49152 b。我使用了这个 powershell 脚本:
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webserver/serverruntime" -name "uploadreadaheadsize" -value 1048576
其实我认为这个脚本也应该工作(它不是那么全球化):
Set-WebConfigurationProperty -PSPath "iis:\Sites" -location "sitename here" -filter "system.webserver/serverruntime" -name "uploadreadaheadsize" -value 1048576
于 2016-05-05T10:08:56.730 回答