![](/img/trans.png)
[英]How to set the maxAllowedContentLength to 500MB while running on IIS7?
[英]How to change the maxAllowedContentLength of IIS 7.0?
我有一个类似的问题: 在IIS7上运行时如何将maxAllowedContentLength设置为500MB?
区别在于我已经修改了web.config
来接受最大2 Gb的文件,但是当尝试上传大文件时,出现以下错误:
请求过滤模块被配置为拒绝超过内容长度的请求。
我的web.config
是这样的:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<httpRuntime executionTimeout="999999" maxRequestLength="2097151"/>
<customErrors mode="Off"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
<membership>
<providers>
<clear/>
</providers>
</membership>
<profile>
<providers>
<clear/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
</providers>
</roleManager>
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2097151" />
</requestFiltering>
</security>
</system.webServer>
尝试上传仅131 MB
的文件时,我仍然收到错误消息。
因此,我应该在maxAllowedContentLength
设置中设置什么以允许人们上传超过100 MB的文件?
MaxRequestLength
是千字节数,而maxAllowedContentLength
是字节数 。 再次将其乘以1024,它应该可以正常工作。
maxAllowedContentLength
可选的uint属性。
指定请求中内容的最大长度,以字节为单位。
默认值为30000000。
http://msdn.microsoft.com/zh-cn/library/ms689462(v=vs.90).aspx
在Windows Run(WinKey + r)中键入inetmgr ,在左侧面板上单击服务器名称,然后在IIS部分的右侧面板中,双击“请求筛选”。 在最右侧的面板上,单击“ 编辑功能设置...” 。 在“ 请求限制”部分中,您可以更改maxAllowedContentLength 。
如果你想只是在你的网站的一个变化maxAllowedContentLength,左侧面板中选择您的站点下站点和同路如上去改变它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.