解决办法:在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

相关文章:

  • 2021-09-28
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-01-30
猜你喜欢
  • 2021-06-21
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-01-25
  • 2022-01-14
相关资源
相似解决方案