How to upload more than 400 MB size file using SharePoint Online rest API? RRS feed

  • Question

  • Using below code, I can upload the video file 2 MB is working for me in all browsers.

    addFileToFolder(data: any, filename: string) {
            let CustomListAssestName: string = this.CustomListAssestName;    
            var serverRelativeUrlToFolder = "decodedurl='" + <SiteCollectionUrl> + "/" + <LibraryName>+ "'";        
            var fileuploadEndPoint = this.siteUrl + "/_api/Web/GetFolderByServerRelativePath(" + serverRelativeUrlToFolder + ")/files" + "/add(overwrite=true, url='" + filename + "')"
            let headers = new Headers(
                { "accept": "application/json;odata=verbose", 
                "content-Type": "application/json;odata=verbose" }); // ... Set content type to JSON
            let options = new RequestOptions({ headers: headers });
            return <Post api call>(fileuploadEndPoint, data.result, options).toPromise();

    But, more than 70MB video file is not working for me in chrome browser.  It crash the application. I could not get any response from Post API  call.

    Using IE browser, I can't upload more than 230 MB video file. I could not get any response from Post API call.

    Can you suggest the max upload size for SharePoint Online rest API?

    Or any other way to achieve this?

    Thursday, December 21, 2017 12:10 PM


  • Hi,

    SharePoint Online has a limitation about uploading files which is larger than 250MB file size using Rest API, the Rest API won't work, and this limitation not only for Rest API, for .NET CSOM, it will have the same limitation.

    A workaround is to use the File Chunk to upload larger files in SharePoint Online, you can check the blog below which will fix this issue:

    Always use File Chunking to Upload Files > 250 MB to SharePoint Online


    Best Regards

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, December 22, 2017 8:15 AM

All replies