

Path property), and APIs such as MoveTo.Įxisting String-based URL APIs will still work as they have always, but because of backwards compatibility implications, they cannot be used with files with # and % in the name. Throughout the object model, you will find ResourcePath used wherever we formerly took URLs, including Web.GetFileByServerRelativeUrl methods, File and Folder objects (which now have a. This class will be used to represent URLs across our APIs instead of string. It stores, expects, and returns the decoded format of the file path.
Office 365 onedrive for business how to share full#
This class can represent full (absolute) or parts (relative) of a URL for a site collection, site, file, folder or other artifact in SharePoint. Specifically, we’ve introduced a new class (). To remove the ambiguity around intention, and to avoid breaking backwards compatibility with existing APIs, we are introducing a strongly typed, rich-featured representation of URLs to better represent the true developer intention of a URL. In the future, when a user wants to have both files ‘Hello%20World.txt’ and ‘Hello World.txt’ within a SharePoint document library, the above API cannot resolve both files discretely.

GetFileByServerRelativeUrl(“/Shared Documents/Hello World.txt”) (where %20 is an encoded representation of a space.) GetFileByServerRelativeUrl("/Shared Documents/Hello%20World.txt") Therefore, the following calls resolve to the same file within SharePoint: The % character is used in encoded URLs to denote special characters, and currently, SharePoint uses that as a hint that the incoming URL has not been previously decoded. Once the # character becomes a supported character in file names, the file path becomes ambiguous the implied file could be either “Hello.txt” or “Hello.txt#123”. We presume that name of the file is “/Shared Documents/Hello.txt” and we ignore the fragment “#123”. Web.GetFileByServerRelativeUrl("/Shared Documents/Hello.txt#123") For example, in the current scenario when the developer calls:

# characterĬurrently, when a developer passes URLs as a string with the # character in them, our API assumes that they mean a URL fragment as per RFC 3986, which is not significant to the file name. Now that we are moving to support # and % characters, this seamless interpretation of URLs can cause ambiguity. Previously, there was no specific guidance around whether these URLs are decoded or percent-encoded, and SharePoint attempted to seamlessly handle all cases. Behind the scenes, our APIs currently take in URLs as a String.

To understand why this requires partners to evaluate many of their solutions, consider how we’ve been representing files in our APIs. Please read the following to understand how these changes might affect your existing solutions. These trials will be opt-in by tenants, and we’ll evaluate how to roll out the feature more broadly over time. Over the next several weeks we are working to start trials of a process to support # and % characters in file names across SharePoint Online and OneDrive for Business. We are still finalizing our full API set to support this, but want to work with partners early to adapt to this change. This, however, requires significant changes to our APIs that will impact partners that work with URLs and file names in SharePoint. To improve this, we’ve broadened the set of supported characters in OneDrive and SharePoint filenames and folders over time and are now working to support # and % characters. Enabling customers to seamlessly work with files and folders across end points is a key area of focus for the SharePoint team.
