
Now we need to add some interface elements to our project to allow us to pick files and upload them. Var result = await uploadProvider.GetChunkRequestResponseAsync(request, readBuffer, exceptions) Var chunkRequests = uploadProvider.GetUploadChunkRequests() Chunk size must be divisible by 320KiB, our chunk size will be slightly more than 1MBĬhunkedUploadProvider uploadProvider = new ChunkedUploadProvider(uploadSession, graphClient, fileStream, maxSizeChunk) UploadSession = await graphClient.Me.(fileToUpload.Name).CreateUploadSession().Request().PostAsync()

UploadSession = await .ItemWithPath(fileToUpload.Name).CreateUploadSession().Request().PostAsync() Do we want OneDrive for Business/Consumer or do we want a SharePoint Site? Stream fileStream = (await fileToUpload.OpenReadAsync()).AsStreamForRead()
Public async Task
/ Take a file greater than 4MB and upload it to the service
To implement the large upload pattern add the following method to your class: ///In this pattern we instruct the service to begin a session that we will then upload chunks of data to one at a time. To upload files larger than 4MB we need to use the CreateUploadSession pattern. Private const string GraphAPIEndpointPrefix = "" Private const string AADClientId = "YOURAPPIDHERE"


We recommended that you have finished the basic console application sample from Day 15. Today we will interact with files stored in OneDrive.įor today’s sample we’ll be using Visual Studio Community edition. In Day 28 we created a webhook notification for Microsoft Graph events. List of all posts in the #30DaysMSGraph series
