maxAllowedContentLength 应该在 IIS 7+ 服务器上工作,但显然我的服务器在上传(ASP.NET MVC 3 网站)时不想考虑这个值。现在我在 web.config 中包含了 maxRequestLength 一切都开始工作并应用了该值。然而,每个人都在说 maxAllowedContentLength 是正确的。
有没有人对这种行为有解释?
最佳答案
看看下面的链接 - 它解释了两者之间的区别。如果您要上传大文件,则需要同时设置两者。请注意,您也可以将此设置嵌套在 <location>
中。标记以免将设置应用于整个网站(我推荐)。
Confusing required maxRequestLength and maxAllowedContentLength settings
关于asp.net-mvc - IIS 7.5 上的 maxRequestLength 与 maxAllowedContentLength,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11300232/