简体   繁体   English

在IIS中设置maxAllowedContentLength的最佳做法是什么?

[英]What's the best practice when setting maxAllowedContentLength in IIS?

In our ASP.NET application some users hit maxAllowedContentLength limit (which is set to 32 megabytes in our application) when sending large POST requests. 在我们的ASP.NET应用程序中,某些用户在发送大型POST请求时达到maxAllowedContentLength限制(在我们的应用程序中设置为32兆字节)。

Suppose we just blindly increase the limit to half gigabyte - what problems should be expect? 假设我们只是盲目地将限制增加到半GB-应该期待什么问题? How do we know the safe value for this limit? 我们如何知道此限制的安全值?

You really don't want to bump this up site wide as it opens you up to DOS attacks using very large sets of data. 您真的不想在整个站点上都碰到它,因为它使您可以使用大量数据来进行DOS攻击。

The easiest solution is to simply declare a <location> element for the specific endpoint you are uploading data to, and set the limit to be higher there. 最简单的解决方案是为要向其上载数据的特定终结<location>声明一个<location>元素,并将限制设置为更高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM