New MAXPATH limits in SharePoint and OneDrive
Published May 09 2017 05:40 AM 55.7K Views
Microsoft

@williambaer

 

Last month we announced support for # and % across SharePoint and OneDrive (https://techcommunity.microsoft.com/t5/SharePoint-Blog/New-support-for-and-in-SharePoint-Online-and-...) and now in addition to adding support for # and % we’re also increasing MAXPATH or otherwise SharePoint and OneDrive's Url path length restrictions from 256 Unicode code units to 400. 

 

This new limit section applies to the total length of the URL path to a folder or a file in SharePoint Online and OneDrive for Business but not to the length of any parameters. Also, these limitations apply only to un-encoded URLs, not to encoded URLs. There is no limit to encoded URLs in SharePoint Online and OneDrive for Business.


For additional information on SharePoint Url composition, refer to the details below:


The total length of a SharePoint URL equals the length of the folder or file path, including the protocol and server name and the folder or file name, plus any parameters that are included as part of the URL.

 

The formula is as follows:


URL = protocol + server name + folder or file path + folder or file name+ parameters


For example, the following is a typical URL path to a file stored in SharePoint:
http://www.contoso.com/sites/marketing/documents/Shared%20Documents/Promotion/Some%20File.xlsx
Where the parts of the URL path are as listed in the following table.
 
URL part  Example
Protocol http://
Server name www.contoso.com/
Folder or file path sites/marketing/documents/Shared%20Documents/Promotion/
File name Some%20File.xlsx

 

The limit applies to the combination of path and name after decoding, so it is sites/marketing/documents/Shared Documents/Promotion/Some File.xlsx.

16 Comments

This should help customers maintain a familiar folder structure when moving from file server to SharePoint/OneDrive. Familiarity assists adoption.

Microsoft

Can't thank enough for this major upgrade. May I know the dependecies of this implementation as the Windows clients should be using any specific versions? If anyone is using "Windows Explorer" option will Windows understand this long url limits? If this is YES, then what version of Windows 10 user should be on?

 

-Praveen.

Deleted
Not applicable

That four-letter word I always seem to have to ask: w-h-e-n?

 

Edit: per response on Twitter, it is available today.

Deleted
Not applicable

Finally....

 

Thanks for the heads-up

 I actually tried to upload a file via PowerShell into a very deep subfolder hierarchy, and managed to do so successfully, even though the final path length is 430 characters:

https://modery.sharepoint.com/sites/demo/MaxPathTest/0123456789012345678901234567890123456789/012345..."

If I try to add another file called test2.txt, it fails.

 

Are the protocol and the server name truely part of the path length restriction? https://modery.sharepoint.com/ is exactly 30 characters long

 

Are the Protocal and the server name really part of the path limit? I was able to create a folder hierarchy and upload files up to a path length of 430 characters, 431 failed. The length of my Protocol+server name is 30 characters (including the / at the end, as in the example above). Tenant name is 6 characters long, so https://abcdef.sharepoint.com/ would be an example

Copper Contributor

René Modery,

 

According to the line, "This new limit section applies to the total length of the URL path to a folder or a file in SharePoint Online and OneDrive for Business but not to the length of any parameters", the length does not include the parameters.

 

 

Copper Contributor

Hi,

 

When its coming to SharePoint 2016 on-premise?

Iron Contributor

Is there an easy way to check if it is enabled on your tenant?

 

Maurits: if you want to do it manually, simply create a folder with a long name (e.g. 012345678901234567890123456789 for 30 characters), go inside the folder. Create a subfolder with a lot of characters as well, and repeat. 

Other option is to use the PnP PowerShell cmdlets to do exactly that. You can get them here: https://github.com/sharepoint/pnp-powershell . And I added a sample script here: https://modery.net/increased-path-length-for-files-in-sharepoint-online-and-onedrive

Brass Contributor

Excellent...I will save a screenshot of this blog to my OneDrive-MyCompany\ThankYou\BillBaer\SharePoint\Awesome\#1\100%rolledoutto\SPO\Not\SP2016\yet\Updates\2017\05\09\0540\AM\ sub-folder!  Thanks @Bill Baer!  These updates do help those of us that help users that take sub-folders very seriously.  Off topic - thank you to the SharePoint search team for helping me find their stuff.  

Copper Contributor

Any idea when this will be fixed for File Explorer on the back end? Our Office365 Sharepoint Online (2013) environment has missing files when we pull up document libraries in Explorer view; they are visible in Sharepoint.

Copper Contributor

This MAXPATH along with special character fix seems like the solution to my Mac OS X / Keynote issues that crash OneDrive on my Mac. That issue has existed for 3 years, so if this fixes it, I am super stoked!

 

 

Copper Contributor

Windows still have 256 char limitation .

 

So when we sync files from Cloud to the Desktop local machine  it crash

Also, The Explorer view  doesn't show files if it exceed the limit

Brass Contributor
If you need to shorten many paths systematically, there is only 1 tool on the market the does this Path Too Long Auto Fixer (http://pathtoolongautofixer.blogspot.com/). It scans for directories and filenames that are longer and 260 characters, and auto shortens them. You have options how the shortening process works, like removing Unicode spaces, hyphens/dashes, underscores and punctuations.
Iron Contributor

I'm pretty amazed that path lengths still continue to plague users. Just had a ticket in from a user who was unable to save a document from Word because the overall path length was bouncing around 250 characters. I don't know where this extended path has been implemented but it's certainly not in their Office 365 tenant, Word 2016, Windows 10 combination. 

 

The problem appears to be in the "Save-as" system. One can create paths that exceed 250 characters (or whatever) in the browser which can then be opened in Word 2016 - and saved. But try and "Save-as" and stick a "2" on the end, and it generates an error.

Version history
Last update:
‎May 17 2017 01:57 PM
Updated by: