none
Restrict File Overwrite in SharePoint 2013 RRS feed

  • Question

  • Hi:

    Looking for, hopefully, two things: 1: ) Tutorial on how to add Javascript to a specific document library page to uncheck the FILE OVERWRITE on a document upload so that the default is unchecked AND 2: ) Either the name of the REPLACE IT button in css or a way to turn off the REPLACE IT button when a drag and drop occurs and the file name already exists  A way to make ONLY the DON'T UPLOAD button appear and be functional and the REPLACE IT to be hidden and not functional.  Only need to do the above in selected sites.

    Appreciate any help, thank you.

    Chuck

    Monday, March 13, 2017 7:57 PM

Answers

  • Hi,

    For front-end solution, here is the solution for your reference.

    Uncheck the “Add as a new version to existing files” by jQuery, here is the sample code(add to master page).

    <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.min.js"></script>

        <script type="text/javascript">

            $(document).ready(function () {

                //alert("jquery is working " + document.title);

                if (document.title == "Add a document") {

                    $("input[id$='OverwriteSingle']").attr("checked", false);

                    $("input[id$='OverwriteMultiple']").attr("checked", false);

                }

            });

    </script>

     

    Hide ‘Replace’ button by CSS for your document library.

        <style type="text/css">       

            #ms-conflictDlgReplaceBtn {

            display:none;

            }

    </style>

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by ChTraywick Tuesday, March 14, 2017 1:31 PM
    Tuesday, March 14, 2017 7:55 AM

All replies

  • Hi,

    You can check out this

    https://social.technet.microsoft.com/Forums/office/en-US/3571e1d0-a37d-481e-a615-5ae27e0cc4d8/restrict-users-to-overwrite-files-in-document-library?forum=sharepointgeneralprevious


    Please remember to click Mark as Answer on the answer if it helps you

    Monday, March 13, 2017 8:05 PM
  • Hi,

    For front-end solution, here is the solution for your reference.

    Uncheck the “Add as a new version to existing files” by jQuery, here is the sample code(add to master page).

    <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.min.js"></script>

        <script type="text/javascript">

            $(document).ready(function () {

                //alert("jquery is working " + document.title);

                if (document.title == "Add a document") {

                    $("input[id$='OverwriteSingle']").attr("checked", false);

                    $("input[id$='OverwriteMultiple']").attr("checked", false);

                }

            });

    </script>

     

    Hide ‘Replace’ button by CSS for your document library.

        <style type="text/css">       

            #ms-conflictDlgReplaceBtn {

            display:none;

            }

    </style>

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by ChTraywick Tuesday, March 14, 2017 1:31 PM
    Tuesday, March 14, 2017 7:55 AM
  • Hi:

    Thank you, works.  Was worried that we'd have to parse through the almost 14K lines of core css :)

    Appreciate the help.

    Chuck

    Tuesday, March 14, 2017 1:31 PM