SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a multiple document libraries used in different projects in Sharepoint. Each document library in each project needs to have a unique naming convention for the files. For example. One of the library will use the naming convention as Cust1-Proj1-Dept1-Ver1.01.doc Another file in the same library will be like Cust2-Proj2-Dept3-Ver1.35.doc We want to force the users to upload the files to this particular library only in this naming convention. If someone uploads another file with just abc.doc as the file name, it should be rejected or display a warning message saying that, "for this particular document library please upload files in this format".

share|improve this question

You could code an event receiver catching the ItemAdding and make some logic to ensure the naming convention is respected. The, you could cancel the event and set the good error message to the user.

share|improve this answer

Your Answer


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.