Hide "Upload" Button of a Document Library in SharePoint 2013
Requirement: Disable upload button in SharePoint document library!
But why? Because, we wanted users to fill the form by creating new document from the New drop-down and not to upload any existing documents with Upload button. So we need to hide upload button in SharePoint 2013.
Solution: CSS! Place this CSS either in Master page or script editor/content editor of the target page.
CSS Styles to hide Upload button in SharePoint 2013:
You may also want to disable "Open in Explorer" as it allows multiple file upload. Use this CSS to hide "Open in Explorer" from SharePoint 2013 ribbon.
Result: Upload button disabled in SharePoint 2013 document library!
Disable Drag and Drop feature of SharePoint 2013:
How about disabling Drag-Drop feature? Well, use this script to disable Drag and Drop feature of SharePoint 2013 document libraries:
How to Disable Upload Button and Drag and Drop Feature in SharePoint 2016:
Edit and Add a script editor on the target list view page (AllItems.aspx), place this code in it.
But why? Because, we wanted users to fill the form by creating new document from the New drop-down and not to upload any existing documents with Upload button. So we need to hide upload button in SharePoint 2013.
Solution: CSS! Place this CSS either in Master page or script editor/content editor of the target page.
CSS Styles to hide Upload button in SharePoint 2013:
<style type="text/css"> #Ribbon\.Documents\.New\.AddDocument-Large, #Ribbon\.Documents\.New-MediumMedium-0-1 { display:none !important; } </style>Hide "Open with Explorer" button in SharePoint 2013 ribbon:
You may also want to disable "Open in Explorer" as it allows multiple file upload. Use this CSS to hide "Open in Explorer" from SharePoint 2013 ribbon.
#Ribbon\.Library\.Actions-LargeMedium-1-1
Result: Upload button disabled in SharePoint 2013 document library!
Disable Drag and Drop feature of SharePoint 2013:
How about disabling Drag-Drop feature? Well, use this script to disable Drag and Drop feature of SharePoint 2013 document libraries:
<script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(function() { g_uploadType = DragDropMode.NOTSUPPORTED; SPDragDropManager.DragDropMode = DragDropMode.NOTSUPPORTED; }, "DragDrop.js");
How to Disable Upload Button and Drag and Drop Feature in SharePoint 2016:
Edit and Add a script editor on the target list view page (AllItems.aspx), place this code in it.
<style type="text/css"> #Ribbon\.Documents\.New\.AddDocument-Large, #Ribbon\.Documents\.New-MediumMedium-0-1, #Ribbon\.Library\.Actions-LargeMedium-1-1 { display:none !important; } /* Hide "Drag files here to upload" message in the List view */ div.ms-dragDropAttract-subtle{ display: none } /* Upload button in Doc Lib tool bar */ #QCB1_Button2 { display:none !important; } </style> //Disable Drag and Drop Upload Feature <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(function() { g_uploadType = DragDropMode.NOTSUPPORTED; SPDragDropManager.DragDropMode = DragDropMode.NOTSUPPORTED; }, "DragDrop.js");
Hide "Upload" Button of a Document Library in SharePoint 2013
Reviewed by Unknown
on
October 17, 2015
Rating:

Wonderful.. Thanks
ReplyDeleteI do not understand where to put the script without breaking the page.
ReplyDeleteJust add a content editor web part and place the above code in it!
DeleteGreat post!
ReplyDeletewhat about pages with modern experience?
ReplyDeleteThis sounded like exactly what I wanted but when I add the Hide Upload Button script, I lose the FILES and LIBRARY tabs on the ribbon, not just the Upload Document button. I added a Script/Content Editor webpart to my library page, then pasted in the script with no changes. I am using Enterprise 2013.
ReplyDeleteAm I doing something wrong? Or is hiding the tabs not the button the intended behavior? This is a picture library. Thanks!!