Update UploadSession to implement new IUploadSession interface#45
Merged
MIchaelMainer merged 2 commits intomasterfrom Dec 6, 2019
Merged
Update UploadSession to implement new IUploadSession interface#45MIchaelMainer merged 2 commits intomasterfrom
MIchaelMainer merged 2 commits intomasterfrom
Conversation
Contributor
Author
|
Build should succeed once the nuget package with the IUploadSession is out. |
darrelmiller
approved these changes
Dec 6, 2019
Set minimum package reference to 1.19.0-preview.5 to support this checkin.
MIchaelMainer
approved these changes
Dec 6, 2019
|
|
Contributor
How to use the the v1.0 service library with the LargeFileUploadTask described in microsoftgraph/msgraph-sdk-dotnet-core#65You can use your authenticated GraphServiceClient to get the uploadsession like this: var uploadSession = await graphClient.Drive.Items["01KGPRHTV6Y2GOVW7725BZO354PWSELRRZ"]
.ItemWithPath("_hamilton.png")
.CreateUploadSession()
.Request().PostAsync();
LargeFileUploadTask<DriveItem> largeFileUploadTask = new LargeFileUploadTask<DriveItem>(uploadSession);Subsequent steps will be the same. |
Contributor
Author
|
You can also obtain an upload session for a FileAttachement like this var attachement = new AttachmentItem
{
Name = "Attachment.pdf",
Size = fileStream.Length
};
var uploadSession = await graphClient.Me.Messages[messageId].Attachments.CreateUploadSession(attachement).Request().PostAsync();
LargeFileUploadTask<FileAttachment> largeFileUploadTask = new LargeFileUploadTask<FileAttachment>(uploadSession, fileStream);Subsequent steps will be the same |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request
This PR updates UploadSession to implement IUploadSession to provide request builder compatibility with the LargeFileUploadTask work on this PR.
This should be merged in after the PR has been completed and deployed.