SharePoint online Office 365 how to remove or hide Replace It button from file upload dialog box
Introduction:
Here we will discuss how we can hide the "Replace It" button from the "A file with the same name already exists" dialog box in SharePoint Online Office 365 site. If we are adding any document to a document library which is already exists then it will show a dialog box with two buttons like "Replace It" and "Don't Upload". Here our requirement was to hide Replace It button so that no one can replace a file which is already exists. The dialog box looks like below:
Solution:
We can hide button by using css.
<style type="text/css">
#ms-conflictDlgReplaceBtn {
display:none;
}
</style>
Edit the page and add a script editor web part to the page. Add the above code and Save the page.
Now if we will try to upload a file which is already exists, it will display the dialog box which will have "Don't Upload button" like below:
References:
Also you can check out some useful posts below:
Conclusion:
Here we have discussed how to remove or hide Replace It button from file upload dialog box in SharePoint Online Office 365.