Sharepoint file path length - encoded or decoded?

Rick Lecoat 20 Reputation points
2024-07-31T16:07:19.6133333+00:00

I'm trying to understand how to calculate the path length of a file in SharePoint. I know that the limit is 400 characters. However, I'm unclear on what counts toward that total, and whether characters are counted encoded or decoded.

For example:

If the URL was https://company.sharepoint.com/FolderName/MyFile.doc (not a real SharePoint URL format, I know), would that be counted as 52 characters (the number of characters in the example above)?

OR: would it be counted as 62 characters (the number of chars in the URL https%3A%2F%2Fcompany.sharepoint.com%2FFolderName%2FMyFile.doc where special characters have been URL encoded)?

I've been googling this for days and just keep finding conflicting information. Can somebody give a definitive answer? TIA.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,840 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ling Zhou_MSFT 18,100 Reputation points Microsoft Vendor
    2024-08-01T01:41:12.5+00:00

    Hi @Rick Lecoat,

    Thank you for posting in this community.

    According to Microsoft's official documentation, the path length of a file is calculated based on decoding.

    User's image

    For more information on file path lengths, see Part File name and path lengths of this article: Restrictions and limitations in OneDrive and SharePoint.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.