When migrating data from SMB, File Servers to Sharepoint online, You can face an error
The full error will appear as:
“The specified file or folder name is too long. The URL path for all files and folders must be 260 characters or less (and no more than 128 characters for any single file or folder name in the URL). Please type a shorter file or folder name.”
It is important to note that the total length of a URL equals the length of the folder or file path, including the protocol name, server name, folder or file name, and any parameters that are included as part of the URL.
So total URL = protocol + server name + folder or file path + folder or file name + parameters.
For example, a file was uploaded to a library in a SharePoint environment with the following URL:
http://myFarm/sites/mySite/mySubsite/myLibrary/myFolder/myParentFolder/myFile.txt
And the following values would be validated:
- Filename: myFile.txt
- Note: If the uploaded item had been a folder, the limits relating to a folder would have been applied instead.
- Parent folder path : sites/mySite/mySubsite/myLibrary/myFolder/myParentFolder
- Item full path: sites/mySite/mySubsite/myLibrary/myFolder/myParentFolder/myFile.txt
SharePoint imposes a limit on the number of characters that a file or folder path can have. The limits are as follows:
Validated path | SharePoint environment | Maximum length |
Item or file name | On-Premises | 128 |
Item or file name | Microsoft 365/SharePoint 2019 (Insane Mode) | 400 |
Item or file name | Microsoft 365/SharePoint 2019 (Normal Mode) | 400 |
Folder name | On-Premises | 128 |
Folder name | Microsoft 365/SharePoint 2019 (Insane Mode) | 400 |
Folder name | Microsoft 365/SharePoint 2019 (Normal Mode) | 400 |
Document Set name | On-Premises | 128 |
Document Set name – Content Type is not Folder | Microsoft 365 | 255 |
Discussion Board title – Content Type is not Folder | Microsoft 365 | 255 |
Parent folder path | On-Premises | 256 |
Parent folder path | Microsoft 365/SharePoint 2019 (Insane Mode) | 400 |
Parent folder path | Microsoft 365/SharePoint 2019 (Normal Mode) | 400 |
Item full path | On-Premises | 260 |
Item full path | Microsoft 365/SharePoint 2019 (Insane Mode) | 400 |
Item full path | Microsoft 365/SharePoint 2019 (Normal Mode) | 400 |
Folder full path | Microsoft 365 (Insane Mode) on Create only | 255 |