Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In Sharepoint 2010, is there a way to limit the names that folders and files can be given, and is there a way to set criteria for any document libraries that are created by users? Here is what I'd like to accomplish:

  1. files and folders to act the same as adding wiki pages where spaces are converted to hyphens
  2. set a limit on the length of the names of files and folders
  3. set a newly created document library (created by users) to already have the elements required for enterprise keywords and automatically require that the keyword field be set; and force descriptions to be required on the files uploaded to those libraries
share|improve this question

1 Answer 1

For #1 and #2, you will want to take a look at the ItemAdding event receiver. This event runs before the item is fully added to SharePoint. From here, you can perform a simple replace on the file name to convert spaces to hyphens, and check the length of the name. If necessary, you can cancel the add (see the example below).

http://msdn.microsoft.com/en-us/library/ms437502.aspx

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.