Spaces count as characters in a file name or url

Question:  Do spaces count toward the total character limit in file or folder names?

Answer: Yes.

How I tested this.

I created a text file and named it

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.txt

The name is a 124 characters long.  Uploaded it to a Document Library and it works.

Now, try adding some spaces to the file name, the re-upload the file.

You will see this error:

The specified file or folder name is too long. The URL path for all files and folders must be 260 characters or less (and no more than 128 characters for any single file or folder name in the URL). Please type a shorter file or folder name.

More info from Joel Oleson’s blog:

File Names

 

  • Invalid characters: ” # % & * : < > ? \ / { | } ~ 
  • Cannot be longer than 128 characters
  • 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 with the period character

Folder Names

 

  • You cannot use the following characters anywhere in a folder name or a server name:  ~ # % & * { } \ : < > ? / | “
  • Cannot be longer than 128 characters
  • 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 the period character

 

update.

More info from Microsoft on this topic:

http://technet.microsoft.com/en-us/library/ff919564.aspx

1 thought on “Spaces count as characters in a file name or url

Leave a Reply

Your email address will not be published. Required fields are marked *