Search code examples
angularasp.net-corefile-uploadchunks

How to upload video files as chunks in angular (version 8)


I want to upload large video files as chunks to the server using angular HttpClient in angular with aspnetcore web API, as I am having issues with file size limit using multipart file upload.


Solution

  • Tus Library

    Another possible solution is to use the tus library which will chunk your uploads for you and allow uploads to be paused and resumed on demand - even if the client or server connection crashes the upload can still resume when the connection restores.

    Unfortunately, the library must be implemented on the server-side and client-side which makes this cumbersome for supporting all server/client types. There is a community dotNet library available here. For implementation in Angular, you can use the official tus-js-client library. The tus team also provide a live demo for you to test: demo.


    Angular Client Example

    An example Angular client for file uploads to tus server:

    (The upload server used in this example is https://master.tus.io/files/)

    https://stackblitz.com/edit/angular-tus-client

    Please note that a lot of the code implemented in my example is available on the tus-js-client library. Here is another resource I used for understanding tus angular implementation. I am also not affiliated with the library or the creators of the library. I just stumbled upon it in my search for robust upload technology.