HTTP错误404.13

编程入门 行业动态 更新时间:2024-10-18 10:17:47
本文介绍了HTTP错误404.13-ASP.NET Core 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

HTTP错误404.13-找不到请求过滤模块已配置为,以拒绝超出请求内容长度的请求。

HTTP Error 404.13 - Not Found The request filtering module is configured to deny a request that exceeds the request content length.

验证applicationhost.config或web.config文件中的 configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength 设置。

Verify the configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting in the applicationhost.config or web.config file.

我不知道该在哪里配置,在asp core 2中已经更改为改为使用appsettings.json。

I've no idea to where can i config that, in asp core 2 there has change to use appsettings.json instead.

即使已经尝试执行此操作,也没有用。

Even try to do this already, but it's not work.

services.Configure<FormOptions>(options => { options.MultipartBodyLengthLimit = 300_000_000; });

推荐答案

如果使用IIS,则需要添加web.config在您的asp core 2.0应用中。

If you use IIS, you need add web.config in your asp core 2.0 app.

<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <security> <requestFiltering> <!-- This will handle requests up to 700MB (CD700) --> <requestLimits maxAllowedContentLength="737280000" /> </requestFiltering> </security> </system.webServer> </configuration>

如果您不使用IIS,则可以使用 [RequestSizeLimit(long.MaxValue )] 或 [DisableRequestSizeLimit] 属性。

If you are not using IIS you can use [RequestSizeLimit(long.MaxValue)] or [DisableRequestSizeLimit] attribute in your controller.

也可以在Program.cs中添加全局设置:

Also, you can add a global setting in Program.cs:

.UseKestrel(o => { o.Limits.MaxRequestBodySize = null; })

有关更多信息,请参见 github/aspnet/Announcements/issues/267

For more info see this github/aspnet/Announcements/issues/267

更多推荐

HTTP错误404.13

本文发布于:2023-11-16 14:33:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1605153.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!