简体   繁体   English

Kendo UI Angular文件上载组件因大文件而失败

[英]Kendo UI Angular file upload component fails with large files

I am using the Kendo Angular File Upload component within my Angular 7 app. 我正在使用Angular 7应用程序中的Kendo Angular File Upload组件。 The back end is ASP.NET core 2.1 hosting a MVC API via Kestrel. 后端是ASP.NET核心2.1,通过Kestrel托管MVC API。 I can get uploads to work for small files. 我可以上传小文件。 Larger files (120MB) fail with a 500 (Internal Server Error). 较大的文件(120MB)因500(内部服务器错误)而失败。 I have used the following DisableRequestSizeLimit attribute on my endpoint controller method: 我在端点控制器方法上使用了以下DisableRequestSizeLimit属性:

[HttpPost, DisableRequestSizeLimit, Route("Upload")]
public async Task<IActionResult> Post(List<IFormFile> files)
{

Why would large file uploads still fail after using DisableRequestSizeLimit? 使用DisableRequestSizeLimit后,为什么大文件上传仍会失败?

For those of you having similar issues, I managed to resolve this by also adding the RequestFormLimits attribute eg 对于那些有类似问题的人,我设法通过添加RequestFormLimits属性来解决这个问题,例如

[HttpPost, DisableRequestSizeLimit, RequestFormLimits(MultipartBodyLengthLimit = Int32.MaxValue, ValueLengthLimit = Int32.MaxValue), Route("Upload")]

Hope this helps someone. 希望这有助于某人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM