OneDrive / onedrive-sdk-csharp

OneDrive SDK for C#! https://dev.onedrive.com
Other
293 stars 143 forks source link

ItemWithPath can't handle "invalid characters" #236

Closed tvandijck closed 1 month ago

tvandijck commented 7 years ago

in the example here

.ItemWithPath(parentItem.ParentReference.Path + "/" + parentItem.Name + "/relative/path")

should be fixed to:

.ItemWithPath(parentItem.ParentReference.Path + "/" + Uri.EscapeDataString(parentItem.Name + "/relative/path"))

or, the ItemWithPath API itself should handle the right escaping.

Without the escaping I was getting exceptions on invalid characters:

Code: invalidRequest
Throw site: 5669.22a3
Message: Path (/LiveFolders/Pictures Shanon/2004-01-01, Crossfit ) contains invalid trailing character.

Inner error
Code: nameContainsInvalidCharacters

I tried:

but it appears only the Uri.EscapeDataString covers all cases.

baywet commented 1 month ago

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #259 for more information