Using Microsoft's Graph API, you can easily upload files to OneDrive. However, you may run into limitations when uploading files larger than 4MB (as of early 2020). Luckily, we can easily upload large files with an upload session, as demonstrated below.
To learn more about upload sessions, you can refer to the
First thing you want to do is get an access token. This is an example of how to do it with cURL:
Then, you can utilize the C# client, like this:
Oldest comments (1)
I believe a far better solution is to use the LargeFileUploadTask https://docs.microsoft.com/en-us/graph/sdks/large-file-upload?context=graph%2Fapi%2F1.0&view=graph-rest-1.0&tabs=csharp