SharePoint Client Object Model Error: The file or folder name contains characters that are not permitted. Please use a different name.

One of the big drawbacks of the SharePoint Client Object Model (CSOM) is that it has very little documentation. This error was thrown when I tried to create a new List using the class ListCreationInformation for a Developer Site. ListCreationInformation class has one property, Url. Now msdn says, it Gets or sets value that specifies the site-relative URL of the location for the new list. http://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.client.listcreationinformation.url.aspxI thought as with other cases, I am supposed to enter the serverRelativeUrl here. Hence I set a value something like sites/ParentWebUrl/ListRootFolderName. Now when I tried to run the code I got this error:: The file or folder name contains characters that are not permitted. Please use a different name.

Next, just for the sake of testing, I passed only the ListRootFolderName and, the code ran successfully! The List was successfully created with proper values.

I have only faced this issue for a Developer Site. I have tested this condition on Publishing Site, Blog, & Developer Site only.

Still following is a short list of characters that cannot be set as a file/folder names in SharePoint

Site names, subsite names, or site group names

You cannot use the following characters anywhere in a site name, in a subsite name, or in a site or Active Directory group name:

  • Tilde (~)
  • Number sign (#)
  • Percent (%)
  • Ampersand (&)
  • Asterisk (*)
  • Braces ({ })
  • Backslash (\)
  • Colon (:)
  • Angle brackets ()
  • Question mark (?)
  • Slash (/)
  • Plus sign (+)
  • Pipe (|)
  • Quotation mark (“)
  • You cannot start a site name, a subsite name, or a site group name with an underscore (_) character or with the period (.) character.
  • When you create a site name, a subsite name, or a site group name, you cannot use strings that were already used to name managed paths.
  • You cannot use the period character consecutively in the middle of a site name, a subsite name, or a site group name.
  • You cannot use the period character at the end of a site name, a subsite name, or a site group name.

Folder names

You cannot use the following characters anywhere in a folder name or a server name:
  • Tilde
  • Number sign
  • Percent
  • Ampersand
  • Asterisk
  • Braces
  • Backslash
  • Colon
  • Angle brackets
  • Question mark
  • Slash
  • Pipe
  • Quotation mark
  • You cannot use the period character consecutively in the middle of a folder name.
  • You cannot use the period character at the end of a folder name.
  • You cannot start a folder name with a period character.

File names

You cannot use the following characters anywhere in a file name:
  • Tilde
  • Number sign
  • Percent
  • Ampersand
  • Asterisk
  • Braces
  • Backslash
  • Colon
  • Angle brackets
  • Question mark
  • Slash
  • Pipe
  • Quotation mark
  • You cannot use the period character consecutively in the middle of a file name.
  • You cannot use the period character at the end of a file name.
  • You cannot start a file name by using the period character.
  • In addition, file names and folder names may not end with any of the following strings:
    1. .files
    2. _files
    3. -Dateien
    4. _bestanden
    5. _file
    6. _archivos
    7. -filer
    8. _tiedostot
    9. _pliki
    10. _soubory
    11. _elemei
    12. _ficheiros
    13. _arquivos
    14. _dosyalar
    15. _datoteke
    16. _fitxers
    17. _failid
    18. _fails
    19. _bylos
    20. _fajlovi
    21. _fitxategiak

Full details can be found here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s