OpenBinaryDirectUsingPath for CSOM File object
The OpenBinaryDirect method of the Microsoft.SharePoint.Client.File class takes a serverRelativeUrl string parameter. When file paths contain % or # characters, as are now allowed on SharePoint Online, these have to be replaced with their HTML escapes in order for OpenBinaryDirect to work.
Please consider implementing:
public static FileInformation OpenBinaryDirectUsingPath(
to solve this problem more cleanly using the Microsoft.SharePoint.Client.ResourcePath class. This probably applies to SaveBinaryDirect as well, although I haven't tested the latter. Thanks.
Totally agree ! Meanwhile, you can use "OpenBinaryStream" which you can get through "GetFileByServerRelativePath" (but with Context.RequestTimeout up to 1000000 or under depending on your needs).
And for the upload, you can use the "AddUsingPath" method of FileCollection for files under 100MB (also with Context.RequestTimeout upgrated), or the "StartUpload" / "ContinueUpload" / "FinishUpload" methods combo for large files !