none
Error while uploading document with same name in Document library RRS feed

  • Question

  • Hi,

    Whenever I try to upload document with same name in Document library it throws an error. I know its a default behavior but is there any way so that I can upload documents with same name or can we append some unique id with title of the document?

    Please suggest.

    Thanks

    Tuesday, April 28, 2015 12:20 PM

Answers

  • Hi, 

    its not the Title field that is causing the problem, is the physical document name. you need to change the Name of the file to have a unique ID after the name.

    you can create a workflow that starts every time you add a new document, that will update the current item "Path and Name" to be equal to: [Current Item:Name]_[Current Item:ID]. 

    NOTE: as you're running the workflow when the item is created, you might get error on the edit form when you save the file for the first time, because the name of the item is changed in background

    Tuesday, April 28, 2015 1:42 PM
  • No, unfortunately this is not possible. SharePoint treats the file name as the primary key identifier for a document so if you try to upload a second document with the same name it will assume this is a new version of the file. If you have versioning enabled on the document library, it will add this as a new version. If not, it will overwrite the original file with the new one.

    If you need two documents with the same name, you will have to either place them in different folders within a document library or in different document libraries.

    http://stackoverflow.com/questions/11894968/uploading-documents-with-same-name-to-sharepoint-2010


    Regards,
    Rajendra Singh
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
    http://sharepointundefind.wordpress.com/



    Tuesday, April 28, 2015 6:12 PM

All replies

  • Hi, 

    its not the Title field that is causing the problem, is the physical document name. you need to change the Name of the file to have a unique ID after the name.

    you can create a workflow that starts every time you add a new document, that will update the current item "Path and Name" to be equal to: [Current Item:Name]_[Current Item:ID]. 

    NOTE: as you're running the workflow when the item is created, you might get error on the edit form when you save the file for the first time, because the name of the item is changed in background

    Tuesday, April 28, 2015 1:42 PM
  • No, unfortunately this is not possible. SharePoint treats the file name as the primary key identifier for a document so if you try to upload a second document with the same name it will assume this is a new version of the file. If you have versioning enabled on the document library, it will add this as a new version. If not, it will overwrite the original file with the new one.

    If you need two documents with the same name, you will have to either place them in different folders within a document library or in different document libraries.

    http://stackoverflow.com/questions/11894968/uploading-documents-with-same-name-to-sharepoint-2010


    Regards,
    Rajendra Singh
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
    http://sharepointundefind.wordpress.com/



    Tuesday, April 28, 2015 6:12 PM