如何在 IIS7 上运行时将 maxAllowedContentLength 设置为 500MB? [英] How to set the maxAllowedContentLength to 500MB while running on IIS7?

查看:40
本文介绍了如何在 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆