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?
基础教程推荐
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
