Hide Overwrite existing files Option of Upload Document Page in SharePoint 2010

Requirement: Uncheck and Hide Overwrite existing files Option in Upload Document Page of SharePoint 2010.

hide overwrite existing files option in sharepoint 2010

Solution:

If the “Overwrite existing files” option is to be turned off for all uploads, You can locate these lines and Change the Checked=”true” to Checked=”false” in Uploadex.aspx file as below:

  1. <asp:CheckBox id=”OverwriteSingle” Checked=”true” Text=<%$Resources:wss,upload_document_Overwrite_file%>” runat=”server” />
  2. <asp:CheckBox id=”OverwriteMultiple” Checked=”true” Text=<%$Resources:wss,upload_document_Overwrite_version%>” runat=”server” />

Alternatively, let’s set this option only for the specific site. 

  • Login to your SharePoint Web Front End Server, Navigate to: “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\template\layouts” folder
  • Make a backup of the “Uploadex.aspx” file and open it in Notepad.
  • Search for text </asp:Content> from the top and Insert the below code in it.
  • Save and close the uploadex.aspx file. Repeat these steps in all your web front end servers if you have more than one.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
 $(document).ready( function () {
 if(location.href.indexOf('globalfunctions/credit/_layouts/Upload.aspx') >= 0) {

            $("input[id$='OverwriteSingle']").removeAttr('checked');
            $("input[id$='OverwriteSingle']").hide();
            $("label[for$='OverwriteSingle']").hide();
            $("a[id$='UploadMultipleLink']").hide();

      }
 });   
</script>

My requirement is to hide overwrite existing files and upload multiple files options for only a particular subsite, so I’ve wrapped the code inside the “IF” condition. Here is the result of the hidden overwrite existing files option and multiple upload links on the upload page:
hide upload multiple files

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

One thought on “Hide Overwrite existing files Option of Upload Document Page in SharePoint 2010

  • Thank you for this tip. I have a question in this particular step while uploading a doc to SP, how que I also send a couple of field values, for example, if I upload a picture from my portal web form (step form), in SP I want to see a column with the name of the user and another custom field. Do a have to use a Cloud Flow or is there a way to configure this directly in CMR or Portal?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *