0
点赞
收藏
分享

微信扫一扫

ASP.NET Core 上传大文件无法接收的问题

ITWYY 2022-06-22 阅读 43

解决办法:在API项目中配置

1. 在 web.config 文件中 <system.webServer>里加入

<security>

<requestFiltering>

<requestLimits maxAllowedContentLength="1073741822" /><!-- 1GB-->

</requestFiltering>

</security>

2. 在 Startup.cs 文件中的方法 " public void ConfigureServices(IserviceCollection serices) " 中加入代码

services.Configure<FormOptions>(x=>{

x.ValueLengthLimit = int.MaxValue;

x.MultipartBodyLengthLimit = int.MaxValue;

});

- 参考文档:http://stackoverflow.com/questions/40364226/multipart-body-length-limit-exceeded-exception

龙腾一族至尊龙骑

举报

相关推荐

0 条评论