调整IIS的maxAllowedContentLength可通过以下方法实现:
在<system.webServer>节点中添加或修改以下配置(单位:字节):
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="52428800"/> <!-- 50MB -->
</requestFiltering>
</security>
需重启IIS生效。
以管理员身份运行:
Set-WebConfigurationProperty -Filter "system.webServer/security/requestFiltering/requestLimits" -Name "maxAllowedContentLength" -Value 52428800 -PSPath "IIS:\"
此方法无需手动编辑文件,直接生效4。

