C# .NET Core 5 ApiController Action for chunk file uploader

666 Views Asked by At

I am using a .NET 5 MVC web application. To allow file uploading, I am using the ng-file-upload component with chunks settings (resumeChunkSize: 5000).

In ASP.NET 4 I used the MultipartFormDataStreamProvider provider, but on .NET Core 5 I can't find an equivalent. Please help me write an action to get the whole file from requests that contain chunks of a file.

UPDATE

After reading the information and tutorials, I realized that it is necessary to clarify the situation. Almost all articles about uploading files are reduced to either a simple upload (the entire file at once) or to streaming the file. Neither is suitable for me. In fact, I need to upload a LARGE file, so it is divided into small portions (say 1MB) and each such portion is already in the form of a separate request to the server. So in fact, the task is to put the file together using the pieces that come in different requests. Previously (in ASP.NET 4.5) I used (or rather used before me) the MultipartFormDataStreamProvider class, but there is no such class in .NET Core 5.

0

There are 0 best solutions below