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

Null SharepointIds on File upload using Dotnet Graph SDK 5 #2429

Open
sant2006 opened this issue Apr 11, 2024 · 6 comments
Open

Null SharepointIds on File upload using Dotnet Graph SDK 5 #2429

sant2006 opened this issue Apr 11, 2024 · 6 comments

Comments

@sant2006
Copy link

Small file upload using ContentRequestBuilder PutAsync and large file upload using LargeFileUploadTask - both of these have null SharepointIds property in the response drive item. ContentRequestBuilder PutAsync uses DefaultQueryParameters which has no option to add any query parameters. LargeFileUploadTask.UploadAsync has no option to add query parameters to the request.

Expected behavior
Request has option to select SharepointIds or response drive item to have SharepointIds populated along with other properties

Client version
5.37, 5.40

Additional context
I need to make an addition get drive item request to get sharepointids which is inefficient.

@andrueastman
Copy link
Member

Thanks for raising this @sant2006

We'll close this as a duplicate of #2369

@sant2006
Copy link
Author

@andrueastman is #2369 applicable for large file uploads using LargeFileUploadTask also?

@andrueastman
Copy link
Member

Re-opening for clarification.

@sant2006 Any chance you can confirm what you mean by the LargeFileUploadTask?
According to the API specification, there's no way really to specify a $select when the final response comes back. https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0#completing-a-file

@sant2006
Copy link
Author

sant2006 commented Apr 17, 2024

@andrueastman kindly see the note section in the page you have provided above for LargeFileUploadTask. To be more specific SDK4 supported chunked uploading using upload session as described in the page you have posted above and and UploadChunkRequest class which has uploadChunkRequest.PutAsync, putAsync had query option to get sharepointids. I don't think sdk5 has UploadChunkRequest ?? So I've LargeFileUpload task as suggested in the above page which has no query option to get sharepointids,
Thanks

@andrueastman
Copy link
Member

Re-opening for now.

@sant2006 Any chance you could share a sample of how you would pass the query option to the large file upload task to help understand this better?

@sant2006
Copy link
Author

@andrueastman kindly note that the bug I've filed is for "LargeFileUploadTask.UploadAsync has no option to add any query parameters to the request". See the uploadAsync request below, that returns a driveItem , but sharepointIds not populated.
Here is a sample code

var maxRetries = 3;
var maxChunkSize = 16 *320*1024;
var fileUploadTask = new LargeFileUploadTask<DriveItem>(uploadSession, spStream, maxChunkSize);
uploadResult = await fileUploadTask.UploadAsync(progress, maxRetries, default(CancellationToken));

Thanks

@sant2006 sant2006 changed the title Null SharepointIds on File upload using Dotnet SDK 5 Null SharepointIds on File upload using Dotnet Graph SDK 5 Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants