Long file paths in SharePoint and OneDrive for Business

All versions of SharePoint and OneDrive for Business have limitations on the path lengths allowed inside their systems. Current path length limitations float around 250 characters.

In order to help you not manually rename thousands of files, Mover has a unique solution. We redirect all files that will be over the limit into a new library higher up the directory structure, where it will now fit.

Please note that we only modify filenames that are too long by default.

Scripting capabilities for your tenant must be turned on or this technique will not work. Please see this Microsoft support article on how to turn scripting capabilities on.

Example

We turn this:

  • https://contoso.sharepoint.com/sites/Marketing/All Global Clients/Client Projects/The Best Client Name Ever/Project 1/Sub Project 2/Sub Sub Project 3/Reports/Excel Files/My really long file name that is ridiculously long-1234567890987654321.xlsx

into this:

  • https://contoso.sharepoint.com/sites/Marketing/All Global Clients/Client Projects/The Best Client Name Ever/Project 1/Sub Project 2/Sub Sub Project 3/Reports/Excel Files/ClickMe

which links to this:

  • https://contoso.sharepoint.com/sites/Marketing/DoNotTouch/Excel Files-A1B2/

The original directory now contains only a single link file named ClickMe, which when clicked will redirect the browser to the new directory.

The relocated directory will contain a GoBack link as well as all the files from the original directory.

This method maintains the file browser flow that your users expect, without losing any of their data or forcing them to manually restructure anything before a migration.

IE. https://contoso.sharepoint.com/sites/Marketing/DoNotTouch/Excel Files-A1B2/ now contains:

  • /GoBack
  • /My really long file name that is ridiculously long-1234567890987654321.xlsx

This enables us to redirect long paths to a different folder that is hidden from the user, yet still browsable when they try to find their original documents. The overflow folder is named “DoNotTouch” in order to discourage users from using it directly.

Visual Example

User Experience

From an end user perspective browsing and searching ability remains the same. The user, and anyone sharing that content, can click up and down the directory structure normally.

Notes

  • If any file in a directory is deemed too long then we will relocate all files in that directory.