I was just wondering if there is a way of Generating unique filenames when uploading a new document or multiple new documents to a library.

I am trying to avoid a situation where a user might accidently rewite another user document by specifing the same name.

I have though about using a sharepoint designer workflow.



No, this is not directly possible for a single document library. But you could try and look into the Content Organizer feature introduced in SharePoint 2010. It gives you a drop-off library for which you can setup rules to route documentst to other locations based on their content type. The CO has a setting for generating unique filenames in order to deal with duplicate submissions routed to the same destination.

  • Hi Lars, I though about that option. Trouble is, this document library is divided in multiple folders - one for each classroom. the library iselt accepts 2 content types. In this case how would it route to the approriate folder which is teacher specific? the content organizer would need to know from which teacher these files are coming from. thanks – Luis Carvalho Oct 8 '12 at 14:49
  • Hey Luis, ok I see - routing by content type is not the way to go in your case. But you can also route by Metadata on the content type. For example by adding a required classroom field. Users will then be forced to specify it in the drop-off library before the document can be checked-in and routed to the destination. If the Content Organizer is not the right solution for you then you could also consider creating a custom list item event handler that aborts upload on duplicate filenames by setting the SPItemEventProperties.Cancel property to true and the ErrorMessage property to user message – Lars Fastrup Oct 9 '12 at 5:30
  • Hi Lars, I will definetely give give that first option a try. as for the second option it is really a out of scope for me - I know nothing about development, but thanks anyway. – Luis Carvalho Oct 9 '12 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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