Wednesday, June 6, 2012

SharePoint new folder end with additional underscore

SharePoint has a logic to prevent user from using some of the reserved words as folder names (e.g._file, _files, .files).  So when you create a new folder with “_files” in the folder name in any document library, SharePoint will insert a “_” at the end.

For example, if your folder name is “Releases_files”, if you create this folder in any document library via browser or code, the result will be “Releases_files_”.

The work around is make sure there is no “_files” in your folder name, such as “files” or “-files” will work just fine. Apparently this “feature” has been around since MOSS 2007 or could be earlier, I did not know about it until this week, when one of our document migration code failed…

Found my answer through this link, http://objectmix.com/sharepoint/357916-appending-_-foldername-ending-_files.html

Thanks!

3 comments:

  1. Unfortunately, when Visio creates an HTM file, it also creates a folder containing the word "files", used to store various tiny files for display in a browser. If the HTM is uploaded to a SharePoint site, and a new folder is added with the Visio folder name, SP appends an underscore as you have noted. The HTM file HTML code calls for the folder name without the underscore, thus displaying in SP fails. The only known workaround is to manually edit the HTML code in the HTM file, replacing all instances of the folder name with the new folder name containing the underscore.

    ReplyDelete
    Replies
    1. Another workaround for this is to copy the files into your sharepoint library using "Open in Explorer". when you create folders via the sharepoint UI (or drag into the sharepoint UI), it enforces the "_files" rule. however, if you use "Open with Explorer" on your sharepoint library, and just drag the files in directly, it bypasses this rule, and creates your folder with the correct name. The folder will be invisible when viewed by the sharepoint UI, but at least your visio file will work.

      Delete
  2. Mine does not have "files" in the name and it still adds an underscore. Is there a way to get around this?

    ReplyDelete