PUT File upload through SDK does has no space for the new file name #1574
Labels
status:waiting-for-triage
An issue that is yet to be reviewed or assigned
type:bug
A broken experience
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 urlPUT /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
The text was updated successfully, but these errors were encountered: