Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-upload-session is missing upload command #491

Open
dsrink opened this issue Jul 9, 2024 · 2 comments
Open

create-upload-session is missing upload command #491

dsrink opened this issue Jul 9, 2024 · 2 comments
Labels
ToTriage type:feature New experience request

Comments

@dsrink
Copy link

dsrink commented Jul 9, 2024

Is your feature request related to a problem? Please describe the problem.

I am trying to upload a large file in chunks.
Calling mgc with parameters
drives items create-upload-session post --drive-id DRIVE_ID --drive-item-id FILE_ID --body '{ "name": "TARGET_FILE_NAME", "file": {} }'
--> seems to work fine in my case, it yields a legitimate-looking uploadUrl (717 bytes of parameters, starting to count at "?guid=").

But I fail to find the way to use mgc to use that uploadUrl to upload the chunks of the large file.

Describe the solution you'd like.

Which part am I missing here? I assume that "mgc" is missing a command/mode to work with that uploadUrl.

If my assumption is correct, then this request is about adding such a command.

If my assumption is wrong, then this request is to provide details within this issue, and update the documentation accordingly.

Additional context?

When trying to use that uploadUrl with an external script (e.g. with python-requests), I am missing the authentication header / token which was created by "mgc login", therefore I get a HTTP 401 due to missing authentication. So this doesnt seem to be an option either.

@dsrink dsrink added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels Jul 9, 2024
@andrueastman
Copy link
Member

Thanks for raising this @dsrink

At the moment, the CLI does not support sending over file slices using Large File Upload requests similar to other SDKs at the moment with no immediate plans to do so. We'll keep this issue open to track the request to add support for this.

When trying to use that uploadUrl with an external script (e.g. with python-requests). I am missing the authentication header / token which was created by "mgc login", therefore I get a HTTP 401 due to missing authentication. So this doesnt seem to be an option either.

You should be able to use the URL with an external script as the docs explicitly state that the Auth header should not be included. Any chance you can confirm this again with the docs examples below?

https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0#remarks

@andrueastman andrueastman removed ToTriage status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jul 10, 2024
@dsrink
Copy link
Author

dsrink commented Jul 11, 2024

thanks for informing. with your hint that uploadUrl needs no authentication, I invested more time into debugging. Turned out that my instance of python-requests found an outdated .netrc, and used that for authentication, which lead to sharepoint sending me a HTTP 401 Unauthorized. Removing that .netrc and it works.

Nevertheless, while we are waiting (potentially many monthes or even a few years) for this request to be implenented: Is there really no way to do the sliced/chunked upload with mgc?
One option I tried to explore (without success yet) was to use "mgc drive items content put" with some "--headers".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ToTriage type:feature New experience request
Projects
None yet
Development

No branches or pull requests

2 participants