Skip to content

Conversation

@barrett777
Copy link

@barrett777 barrett777 commented Mar 22, 2024

As far as I can tell, creating an upload session for large files has always needed a POST request. The PUT request is just for the content: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online

I tested this with a personal OneDrive account uploading a ~120mb file

According to Microsoft's documentation, this method should be used for any file larger than 4mb

Fixes #16

@JF-B52
Copy link

JF-B52 commented Nov 16, 2024

Do you have a sample ? I spent one week trying to do that unsuccessfully !

@barrett777
Copy link
Author

This PR hasn't been merged so you'll have to use my branch or make the change yourself: https://github.com/barrett777/PowerShellGallery-OneDrive/tree/feature/Fix_Add_ODItemLarge

Then the command is something like this:
Add-ODItemLarge -AccessToken $Auth.access_token -LocalFile $child.FullName -Path $UploadToFolderName

@JF-B52
Copy link

JF-B52 commented Nov 18, 2024

Thanks a lot. Now it's working !

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.

Large file upload returns BadRequest

2 participants