File naming restrictions in SharePoint

Find out what the restrictions are for naming files, file name length, characters and changes in SharePoint Online…

This post is a reference point for all the restrictions and limitations around the restrictions that apply to file names and file types in SharePoint and OneDrive.

When uploading files into SharePoint or OneDrive that are subject to any of the restrictions, you may receive an error similar to something like this:

filename-error

What are the restrictions?

Restrictions have become more difficult to untangle in Microsoft 365 with SharePoint and OneDrive, plus the ability to sync. The key takeaway is that the entire decoded file path, including the file name can’t contain more than 400 characters. This limit applies to the combination of the folder path + file name after decoding:

  • The entire decoded path can’t contain more than 400 characters
  • File uploads cannot exceed 250GB
  • You can’t share more than 50,000 items
  • You can’t copy or move more than 100GB in total, no more than 30,000 files and each file must be less than 15GB

Invalid characters, file or folder names

  • ” * : < > ? / \ | all aren’t allowed in file or folder names, plus leading or trailing spaces
  • # & are supported and can be enabled in the SharePoint admin center
  • .lockCONPRNAUXNULCOM0 – COM9LPT0 – LPT9_vti_desktop.ini, any filename starting with ~$. are not allowed for files or folders
  • forms” isn’t supported when the folder is at the root level for a library
  • You can’t create a folder name in SharePoint that begins with a tilde (~)

Blocked file types

  • There are currently no known types of files that cannot be added to a list or library in SharePoint Online. Custom scripting must be allowed for custom script file extensions to be work
  • Temporary TMP files will not be synced to OneDrive
  • Files that are used by your local computer, such as desktop.ini on Windows or .ds_store on macOS, don’t normally sync
  • Outlook .PST files are supported, however they are synced less frequently compared to other file types to reduce network traffic

File uploads, names and path length

  • The file size limit for uploads is 250GB
  • Each segment of a path cant exceed 255 characters if files are synced to a PC or Mac
  • The length of the root folder in OneDrive, or synced SharePoint library, plus the relative path of the file (up to 400 characters) cannot exceed 520 characters
  • In SharePoint Server, the entire path of files can’t exceed 260 characters
  • Thumbnails are not generated for images larger than 100 MB
  • PDF previews are not generated for files larger than 100 MB

Sharing

  • There is a limit of 50,000 items that can be shared within a folder and any sub-folders
  • You can’t synchronize the Shared with me view grouping of files from a OneDrive for work or school site

Syncing, copying or moving files

  • Although SharePoint Online can store 30 million documents per library, for optimum performance Microsoft recommend syncing no more than 300,000 files across all document libraries. Additionally, performance issues can occur if you have 300,000 items or more across all libraries you are syncing, even if you are not syncing all items in those libraries.
  • If you use the previous OneDrive for Business sync client (Groove.exe), the sync limit per library is 20,000 items (including 5,000 items per team site)
  • Differential sync is possible for Microsoft Office files in the new file format, .docx, .pptx, .xlsx
  • You cannot copy or move more than 100 GB of the total file size
  • You cannot copy or move more than 30,000 files
  • Each file being copied/ moved must be less than 15 GB
  • SharePoint libraries/ lists can hold 50,000 major versions and 511 minor versions
  • When using onedrive.com, you can only copy up to 2500 files at one time

How it used to be – restrictions in SharePoint Sever

Here are some, more specific restrcitions again applying to site collections, sub-sites, libraries or lists:

  • Can’t be longer than 128 characters
  • Can’t use: ~ # % & * { } \ : < > ? / + | ”
  • Can’t use: ~ ” # % & * : < > ? / \ { | }. in SharePoint 2013
  • Can’t use the period character consecutively in the middle of a file name (blah…blah.docx)
  • Can’t use the period character at the end of a file name
  • Can’t use the period character at the start of a file name
  • Can’t end with:

    .files

    _files
    -Dateien

    _fichiers

    _bestanden

    _file

    _archivos

    -filer

    _tiedostot

    _pliki

    _soubory

    _elemei

    _ficheiros

    _arquivos

    _dosyalar

    _datoteke

    _fitxers

    _failid

    _fails

    _bylos

    _fajlovi

References

https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file – Names, paths and namespaces by Microsoft

http://www.sysadminsblog.com/microsoft/file-name-length-and-character-restrictions-for-sharepoint/  – Original write up by Mischa Oudhof of Sysadminblog.com

Leave a Reply

Recent posts

Discover more from SharePoint Stuff

Subscribe now to keep reading and get access to the full archive.

Continue reading