Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

Allow custom upload session url in OneDriveLargeFileUpload.create#1010

Merged
nikithauc merged 6 commits intodevmicrosoftgraph/msgraph-sdk-javascript:devfrom
nikithauc/#917-uploadsession-custommicrosoftgraph/msgraph-sdk-javascript:nikithauc/#917-uploadsession-customCopy head branch name to clipboard
Oct 19, 2022
Merged

Allow custom upload session url in OneDriveLargeFileUpload.create#1010
nikithauc merged 6 commits intodevmicrosoftgraph/msgraph-sdk-javascript:devfrom
nikithauc/#917-uploadsession-custommicrosoftgraph/msgraph-sdk-javascript:nikithauc/#917-uploadsession-customCopy head branch name to clipboard

Conversation

@nikithauc
Copy link
Contributor

fixes #917.

OneDriveLargeFileUpload.create() defaults to creating an upload session for me/drive/root. Adding an option to pass any custom uploadSessionURL different than the default one.

@nikithauc nikithauc requested a review from gavinbarron October 17, 2022 18:22
@nikithauc nikithauc enabled auto-merge (squash) October 17, 2022 18:28
@gavinbarron
Copy link
Member

throw new GraphClientError("Please provide the Graph client instance, FileObject interface implementation and OneDriveLargeFileUploadOptions value");
}
const requestUrl = OneDriveLargeFileUploadTask.constructCreateSessionUrl(options.fileName, options.path);
const requestUrl = options?.uploadSessionURL ? options.uploadSessionURL: OneDriveLargeFileUploadTask.constructCreateSessionUrl(options.fileName, options.path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the optional chaining of options here is not needed as line 166 validates that options has a value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the optional

@nikithauc
Copy link
Contributor Author

Should this PR also update https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/tasks/LargeFileUploadTask.md ?

Updated. Please verify :)

Copy link
Member

@gavinbarron gavinbarron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nikithauc nikithauc merged commit 821d8c2 into dev Oct 19, 2022
@baywet baywet deleted the nikithauc/#917-uploadsession-custom branch November 30, 2022 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uploading files using OneDriveLargeFileUploadTask with only the Files.ReadWrite.AppFolder permission is not possible

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.