首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有办法在不使用.net Core3.1中的web.config的情况下提供maxAllowedContentLength

有没有办法在不使用.net Core3.1中的web.config的情况下提供maxAllowedContentLength
EN

Stack Overflow用户
提问于 2021-02-02 14:13:09
回答 1查看 144关注 0票数 0

如何在不使用web.config的情况下提供maxAllowedContentLength

代码语言:javascript
复制
 <security>
          <requestFiltering>
              <requestLimits maxAllowedContentLength="1073741824" />
          </requestFiltering>
      </security>
EN

回答 1

Stack Overflow用户

发布于 2021-02-02 15:24:04

根据asp.net核心document,如果您没有在IIS上托管应用程序,我们可以尝试设置MaxRequestBodySize

如果您希望在IIS上托管应用程序,则只能在web.config中设置maxAllowedContentLength,因为maxAllowedContentLength发生在MaxRequestBodySize之前。

更多细节,你可以参考下面的描述。

MaxRequestBodySize用于获取或设置HttpRequest的最大请求正文大小。

请注意,IIS本身具有限制maxAllowedContentLength,它将在IISServerOptions中设置的MaxRequestBodySize之前进行处理。更改MaxRequestBodySize不会影响maxAllowedContentLength。要增加maxAllowedContentLength,请在web.config中添加一个条目,以将maxAllowedContentLength设置为更高的值。有关详细信息,请参阅配置。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66004491

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档