By default, client-side scripting has some restrictions while posting large sizes of data in different browsers. While using Angular HTTP post to upload a file, I’m facing an issue —  more than a 100MB file upload breaks in some of the browsers like Chrome, Firefox, etc. Now, I’m using file chunking to post the file as split chunks by SharePoint REST API.

SharePoint-2013-Hosting

Angular + SharePoint Large file upload

Follow the below-listed steps to upload the large files.

Step1

Create a “File upload” component template like below.

Step2

Below is the TypeScript code for the file upload component.

Step3

The important part of chunk based file upload implementation is Angular service. FileUploadService code is mentioned below.

Step4

We should refer the SP.js and SP.RequestExecutor.js in deployed .aspx (or .html) pages to use default SharePoint service request executor to post file.

Finally, the uploaded file will be available in SharePoint Documents Library.