[NetCore 2.1] System.IO.InvalidDataException:“Multipart body length limit 16384 exceeded.”
flyangnet opened this issue · 3 comments
flyangnet commented
baiyunchen commented
请参考:#9
.Net Core对上传内容的大小有限制,需要配置一下~
flyangnet commented
public void ConfigureServices(IServiceCollection services)
{
services.AddUEditorService();
services.AddMvc();
// 加上如下配置
services.Configure(x =>
{
x.ValueLengthLimit = int.MaxValue;
x.MultipartBodyLengthLimit = int.MaxValue; // In case of multipart
});
}
用 IIS Express 和 Kestrel 加了这个配置也不起作用,百度能搜出的方法都试了也不行。
不过我把项目用 IIS 运行就没问题了,谢谢。
Development time IIS support for ASP.NET Core Applications
https://blogs.msdn.microsoft.com/webdev/2017/07/13/development-time-iis-support-for-asp-net-core-applications/
baiyunchen commented
感谢反馈!