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?
基础教程推荐
- 获取C#保存对话框的文件路径 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 如果条件可以为空 2022-01-01
- 将数据集转换为列表 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
