I'm currently in the process of uploading (archiving) Remedy ticket attachments to SPO. When originally extracting attachments from the (Remedy) server, I ran into several instances where a file couldn't be copied from one folder to another, due to filename length restrictions; I was using Server 2008 R2.

My question is, when uploading these files to SPO, will there be a chance of me getting warnings/errors due to filename lengths being too long? Should I go ahead and reformat all my file names to avoid this issue, or will I be okay without?


The character limit for file and folder names length is 400. As long you adhere to that limit, you will be fine. If it exceeds that, then you will receive error like file name too long and that file wont be uploaded.

Also, ensure that file names dont contain invalid characters as below:

\, /, :, *, ?, ", <, >, | , # , %

MS has rolled out support for file and folder names containing # and %, but it needs to enabled by your tenant administrator.

References - Restrictions and limitations when you sync SharePoint libraries to your computer through OneDrive for Business

New MAXPATH limits in SharePoint Online and OneDrive

New support for # and % in SharePoint Online and OneDrive for Business

Types of files that cannot be added to a list or library in SPO

Summarizing - just ensure that file name length is less than 400 characters and it doesn't contain invalid characters and you will be good.


Although Gautam is totally right, I would like to add that even though you may be able to migrate files with say 300-400 path characters to SpO, O4B or Teams, you may not be able to access them depending on whatever client you use, e.g.


Even Excel 2016 and 2019 (non proplus variant) still have this issue and cannot access files with a path length over 218 characters.

So, be aware of those and ensure pre-migration that your paths aren't too long.

If you already migrated, you can use a PS script I wrote to find and fix long paths (files and folders) in Sharepoint Online, Onedrive for Business and Microsoft Teams.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy