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

PUT File upload through SDK does has no space for the new file name #1574

Open
RikvanderLinde opened this issue Sep 3, 2024 · 1 comment
Labels
type:enhancement Enhancement request targeting an existing experience

Comments

@RikvanderLinde
Copy link

Describe the bug

I am trying up upload a file using the SDK, resulting in:
$graphClient->drives()->byDriveId($driveId)->items()->byDriveItemId($itemId.':/'.$filename.':')->content()->put(Utils::streamFor($fileContent))->wait();

As you can see I have to abuse the byDriveItemId DriveId, because the underlying code calls for the url template: {+baseurl}/drives/{drive%2Did}/items/{driveItem%2Did}/content{?%24format*} Which does not allow for the use of the filename, as described in https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http where it should use the url PUT /drives/{drive-id}/items/{parent-id}:/{filename}:/content

Expected behavior

I expect the SDK to support an option somewhere to supply the filename in a correct way, instead of having to string combine it.

How to reproduce

Uploading a file trough the supplied SDK methods as described above

SDK Version

2.12.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

No response

Configuration

No response

Other information

No response

@RikvanderLinde RikvanderLinde added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Sep 3, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Sep 30, 2024

Hi @RikvanderLinde, thank you for your feedback and glad that you found a workaround. To try and reduce the size of the generated library, we are generating a slightly limited set of canonical paths and will look into considering this.

@Ndiritu Ndiritu added type:enhancement Enhancement request targeting an existing experience and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement request targeting an existing experience
Projects
None yet
Development

No branches or pull requests

2 participants