First published on TECHNET on Feb 05, 2018
This post is a contribution from Adam Burns, an engineer with the SharePoint Developer Support team
A while back, I wrote an article explaining that you must use File Chunking if you want to upload files larger than 250 MB to SharePoint or OneDrive for Business, using either the SharePoint REST API or CSOM. This is because the file upload limit is set in the service and cannot be changed. Using the Microsoft Graph API is even more restrictive. The file size limit for uploading files is so small (4 MB) that you really should always use the chunking method, but the implementation is a little different than it is with the SharePoint REST API. Also, to get an access token for Graph you will always need to use an Azure AD authorization endpoint.
The main operation you need is /createUploadSession. The details of the API are clearly documented here: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession#crea...
You’ll need to write more code than you may expect, to do this correctly.
Here are the main steps you need to perform to upload a file using the /createUploadSession approach:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.