- A given element (file or folder) cannot be more than 128 characters.
- A total file path including full path + file name cannot be more than 260 characters.
- All must be URL encoded so many characters count as 3 characters. This means the limit can be reached faster than expected.
- Domain: domain.com
- User: test.user@domain.com
- Folder: /folder
- File: this & that.docx
It is reasonable to assume the file is /folder/this & that.docx, 24 characters. However, when using the API, we have to use the complete OneDrive path, which is this case would be:
/personal/test_user_domain_com/Documents/folder/this & that.docx
This is 64 characters.
We also have to URL encode this string:
%2Fpersonal%2Ftest_user_domain_com%2FDocuments%2Ffolder%2Fthis%20%26%20that.docx
When applying file permissions, we use the full file path to the file, which is even longer:
https://domain-my.sharepoint.com/personal/test_user_domain_com/Documents/folder/this & that.docx
Then we URL encode this, resulting in the following file path URL:
https://domain-my.sharepoint.com%2Fpersonal%2Ftest_user_domain_com%2FDocuments%2Ffolder%2Fthis%20%26%20that.docx
This is 112 characters, when the file appears to be only 24 characters.