Alexander’s Blog

November 20, 2008

Good Stuff to Know About SharePoint Files, Folders, URLs, Sites and the Like

by @ 8:33 pm. Filed under SharePoint, Tips & Tricks

When working with SharePoint, one question that comes up often is what are the restrictions on file names, folders, and URLs. I have been gathering information from various Microsoft resources to compile a list. The following applies to WSS 2.0, WSS 3.0, SPS 2003, and MOSS 2007.

File & Folder Restrictions

- You cannot use the characters ” # % & * : < > ? \ / { | } ~ in a file or folder name.

- A file or folder name in a URL cannot contain more than 128 characters in WSS 2.0/3.0 and MOSS.

- You cannot start or end a file name or folder with a period. For example, .MyFile.docx and MyFile.docx. are both invalid names.

- Periods are not allowed consecutively in the middle of a file or folder name. For example, My..Project.file is not a valid name.

URL Restrictions

- The maximum length for a URL in Windows SharePoint is 260 characters. However, I suggest you do not use URLs longer than 256 so users can include the links in the links list, as mentioned in Miscellaneous section below.

Site Restrictions

- You cannot use the characters ” # % & * : < > ? \ / { | } ~ in a site name.

- You cannot start a site name with an underscore. For example, _MySite is not a valid name for a site or a subsite.

- Periods are not allowed consecutively in the middle of a site name. For example, My..Site is not a valid name.

- You cannot start or end a site name with a period. For example, .MySite and MySite. are both invalid names.

Document Libraries

- If you use one of the following characters in a Document Library they will be removed: Comma, hyphen, period, left and right parenthesis ().

Miscellaneous Tips

- Do not use underscores in a site name. Although allowed, Microsoft discourages it.

- Link list items cannot be more than 256 characters.

- If you want to restrict users from creating site names that are too long and will cause problems, you can use the site creation management Web part from Bamboo.

- Blocked file uploads can be easily bypassed in SharePoint by simply renaming the file. For example, report.exe can be easily uploaded by renaming it to report.exz. You will be able to save it to another location and then rename it back. However, you won’t be able to execute it on the server because it will be blocked by SharePoint.

- ForeFront Security for SharePoint will block files based on their content.

- Former MVP and now Microsoft employee Angus Logan has a method to validate SharePoint file names on upload.

9 Responses to “Good Stuff to Know About SharePoint Files, Folders, URLs, Sites and the Like”

  1. Fredrik M Says:

    Could you tell me, why Sharepoint does not allow hyphen in document library?

    Is there some kind of WHY?

  2. Zubair Alexander Says:

    Hi Fredrik,

    That’s a good question and I don’t know the answer.

    Hyphens are allowed in URLs so you would think they should not be a problem in a Document Library name. By “not allowed” I mean that you are able to create Document Libraries with hyphens (even commas) but in the URL SharePoint removes the hyphen (for whatever reason) but leaves the hyphen in the title name.

    If I find the answer to your question I will post it here.

  3. Gold Says:

    Good article. I added you in the ‘Liked’ category.. thanks for sharing the article!

  4. Will Says:

    Good article , I added you in the ‘Liked’ category.. thanks for sharing the article!

  5. Phil Says:

    Great post. While doing some SharePoint development, I hit this brick wall with a hyphen in a document library name and thought my code was wrong. Little did I know that this was by design. Thanks. You’ve saved me hours, if not days, of debugging time.

  6. Zubair Alexander Says:

    Phil,
    I am glad I was able to save you some debugging time.

  7. Tusar Says:

    Is there any work around to allow Link list items to be more than 256 characters?

  8. Zubair Alexander Says:

    I am not aware of any workaround to allow Link list to be more than 256 characters.

  9. Ved Says:

    Did anybody come to know why “Hyphens” are not allowed in List/Library name. Why it is removed by SharePoint if used. On the other note, I see an inconsistency in this behavior. In one environment, it removes “Hyphen” in the document library name but when I check the same behavior in other environment it works fine. It doesn’t remove “Hyphen” in document library name. Strange!!!

Leave a Reply

CAPTCHA Image CAPTCHA Audio
Refresh Image

Comment spam protected by SpamBam

Spam Protection by WP-SpamFree Plugin

Contact E-mail | Terms of Use | Privacy Policy

Copyright ©2010 Zubair Alexander. All rights reserved.

Internal Links

Search Blog

Categories

Archives

February 2012
M T W T F S S
« Jan    
 12345
6789101112
13141516171819
20212223242526
272829  

RSS Feeds

TechGalaxy Visitors

29 queries. 0.379 seconds