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:
- .files
- _files
- -Dateien
- _bestanden
- _file
- _archivos
- -filer
- _tiedostot
- _pliki
- _soubory
- _elemei
- _ficheiros
- _arquivos
- _dosyalar
- _datoteke
- _fitxers
- _failid
- _fails
- _bylos
- _fajlovi
- _fitxategiak
Full details can be found here.