How to set the maxAllowedContentLength to 500MB while running on IIS7?(如何在 IIS7 上运行时将 maxAllowedContentLength 设置为 500MB?)
问题描述
我将 maxAllowedContentLength 更改为
I changed the maxAllowedContentLength to
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="5024000000" />
</requestFiltering>
</security>
在我的 web.config 中,但在 IIS7 上运行时出现此错误:
In my web.config, but when running on IIS7 I get this error:
maxAllowedContentLength"属性无效.不是有效的无符号整数
The 'maxAllowedContentLength' attribute is invalid. Not a valid unsigned integer
但是当我在 VS 服务器上运行时,它运行正常,没有任何错误.
but when I run in the VS server it run normally without any errors.
如何配置我的网站以允许上传大小为 500MB 的文件,而在 IIS7 上没有此问题?
How to config my website to allow upload files with 500MB size, without this problem on IIS7?
推荐答案
根据MSDN maxAllowedContentLength
有类型 uint
,它的 最大值 为 4,294,967,295 字节 = 3,99 gb
According to MSDN maxAllowedContentLength
has type uint
, its maximum value is 4,294,967,295 bytes = 3,99 gb
所以它应该可以正常工作.
So it should work fine.
另请参阅请求限制文章.如果根本没有配置相应的部分,IIS 是否会返回这些错误之一?
See also Request Limits article. Does IIS return one of these errors when the appropriate section is not configured at all?
另请参阅:超出最大请求长度
这篇关于如何在 IIS7 上运行时将 maxAllowedContentLength 设置为 500MB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 IIS7 上运行时将 maxAllowedContentLength 设置为 500MB?


- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 输入按键事件处理程序 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01