File Path Limit - OneDrive and SharePoint

When moving files to or creating new files and folders within OneDrive and SharePoint, you may receive an error message claiming the “file path exceeds the limit”. This guide shows the technical explanation of file paths, so that you may apply this knowledge to your file organization, both online and on your computer.

The file path contains the file’s name and the name of every parent folder. A “parent folder” is a folder that contains other files and folders. Folders within the “parent folder” are considered its children. An example file path (finding a file within parent folders) is shown below. You can see the file path generating in the address bar above the folders.

For example, you may have a picture saved in your default Windows Pictures folder on your computer named “vacation group photo Dec25th.jpg” The file path of this picture file is C:\Users\daniel\Pictures\camera\vacations\Dec_2012_Vacation_to_Denver\lodge\vacation_group_photo_Dec25th2012.jpg. This file path contains 112 characters and 7 parent folders. You can see the name of your hard drive C:\ and then the name of every folder you need to enter in order to find your file.

Tips for Shortening a File Path

  • The file path limit for OneDrive and SharePoint is 400 characters.

  • The limit for a file or folder name is 255 characters.

  • Try to exclude spaces from file and folder names. A space in a file path will be replaced by %20 in OneDrive, which is now 3 characters instead of a single space. Try using the underscore _ in place of a space.

  • Start with renaming the file in question. If you still need to free up space, start with a top-level parent folder to prevent issues in the future.

The length of the OneDrive root folder (e.g. C:\users\daj13007\OneDrive - University of Connecticut) + the relative path of the file (up to 400 chars) cannot be more than 520 characters.

C:\Users\daj13007\OneDrive - University of Connecticut\Pictures\backgrounds\old classrooms

OneDrive root folder + relative path (limit 400 characters) = <520

Fixing the Above Example

  1. I can shorten the picture’s name, since there is repeated information.

    1. group_photo does not duplicate any information and contains 11 characters instead of 32. The date-taken information is included within the file’s metadata; it does not need to be in the name.

  2. I can remove the “camera” folder. By moving all the sub-folders of camera to Pictures. I will save 7 characters in all future sub-folders.

  3. Looking at the remaining file path, the logical parent folder to edit is “Dec 2012 Vacation to Denver” I can change this to Denver2012 or Denver_Dec2012 to save 17 and 13 characters respectively.

Fixed file path: C:\Users\daniel\Pictures\vacations\Denver2012\lodge\group_photo.jpg with 67 characters.

As you can see, it’s best to avoid special characters whenever possible.

Example: the apostrophe ('), a simple name such as “Dan’s test here” will turn into Dan%27s%20test%20here. This can be shortened greatly by using only underscores: “Dans_test_here” turns into Dans_test_here.

Alternate: Moving Folders Closer to the Root

If you have reached the file path limit and have many files/folders that are beyond the character limit, consider moving folders closer to the root.

The “root” is the top-most level of your folders. When you are at your root, you have not clicked on any folder to open it; you’re at the highest level of your folder structure.

Right click on any of the folders within the file path in question and move the folder 'up' in the path. You do this by moving the folder out of its parent folder and to a folder at the root or higher up in the file path.

  1. Navigate to s.uconn.edu/onedrive.

  2. Click on My Files in the lefthand menu.

  3. Find the parent folder in the file path and open it.

  4. Click on a folder that has many child folders.

  5. Right-click and Move this folder to a folder at the root or higher up in the file path.

Related Articles