Disable the "Upload" button of a Document library in SharePoint 2010
There are two ways to disable the upload button :
1st way :
Open your site using SharePoint Designer. Once opened, navigate to your Library and edit your default view. (All Files -> Your Library -> Forms -> Your View.aspx, right click and select Edit File in Advanced Mode)At the bottom of the screen you will see three options Design, Split, and Code. Select the Split option.
In your code window, locate the <asp:Content ContentPlaceHolderId=”PlaceHolderMain” runat=”server”> tag.
Now, scroll down and find the closing </asp:Content> tag. Insert a line above the closing tag. Place the following code into that newly created blank line.
<style type="text/css">
#Ribbon\.Documents\.New\.AddDocument-Large
{
display:none;
}
{
display:none;
}
#Ribbon\.Library\.Actions\.OpenWithExplorer-Medium
{
display:none;
}
</style>
Click save, then refresh your page. The Documents tab should now be missing the Upload Document button and the Library tab should be missing the Open with Explorer button.
Using IE, you can find the ID’s of the other buttons in the ribbon. With your View open in IE, click F12. Once Developer Tools finishes loading, select Find from the top menu, then click on Select Element by Click. Back in IE, click on the button you want the ID of.
Now users have to use the "New" button to create a new document and cannot use the upload button.
Keep in mind that you'll have to do this for each view that the users have access to, as each view has it's own page that will need editing.
{
display:none;
}
</style>
Click save, then refresh your page. The Documents tab should now be missing the Upload Document button and the Library tab should be missing the Open with Explorer button.
Using IE, you can find the ID’s of the other buttons in the ribbon. With your View open in IE, click F12. Once Developer Tools finishes loading, select Find from the top menu, then click on Select Element by Click. Back in IE, click on the button you want the ID of.
2nd Way :
I would like to show this by giving an example :-
Suppose i have a document library that uses Infopath form it is termed as Form Library.
When a new form is submitted , a series of workflows are triggered and corresponding task is assigned , etc. I had an issue where workflows were getting started multiple times and the task are also assigned , and generally causing chaos.
I traced the issue, that users were not using the "New Document" button to create a form,but were also saving old forms and re-uploading them using the "Upload" button which results in duplicate files and duplicate workflows etc.
I resolved the issue by simply removing the upload button from the edit.aspx page in each library using the SharePoint Designer.
Steps to do so :
1. Click on the SharePoint Designer to open the edit.aspx page.
2. In Design view right click the List View Web part and select the XSLT data View from the context menu.
3. Switch to split view and locate the "New" button, and you will see the XSLT code.
4. Set the "td " visibility as "hidden" as shown below :
In order, to prevent an unsightly 'blank space' in the menu, I moved the location of the hidden button to the last button on the right of the menu.
Now users have to use the "New" button to create a new document and cannot use the upload button.
Keep in mind that you'll have to do this for each view that the users have access to, as each view has it's own page that will need editing.
Thanks
Any Question/Suggestion ??
Clear and perfect! Awesome bro!
ReplyDeleteCan we disable the New Document & New Folder Option the first way?
ReplyDeleteLooks like you stole some content from http://practicalsharepoint.blogspot.ca/2010/09/disabling-upload-button-on-document.html ??
ReplyDeleteThis comment has been removed by the author.
DeleteBut this guy copied you.... http://sharepointbuddies.blogspot.ca/2013_04_01_archive.html
DeleteFantastic help thank you !
ReplyDeleteGreat Help. I have used this to remove upload button in SP2013 but would also like to remove Drag and Drop feature any ideas??
ReplyDeleteThis is the best kind of posted solution: simple, clear and effective. Thanks
ReplyDeleteJust used solution #1 today and it worked perfectly.
ReplyDeleteThank you
Awesome.. Thanks!
ReplyDeleteThe given information in this article is very informative
ReplyDeletesharepoint 2013 administration certification
Say you've got multiple libraries with multiple views. You'd have to update multiple files if any edits to the "style" tag properties was required; a maintenance nightmare! Is there a way to reference or link to a source file instead? I tried the "link" tag but that's not valid within the "div" tag of the "asp:content" tag.
ReplyDeleteThe first way gives an error from SharePoint Designer but lets you save it.
ReplyDeleteI am using Standalone on premise SharePoint 2016
But this code below works: if you will follow step 1 here but use my code below instead inside the Style element:
(It will Hide both the +New Button and the Upload Button):
button#QCB1_Button1 {
display: none;
}
button#QCB1_Button2 {
display: none;
}
I tried JQuery and JavaScript ideas but they weren't working. It appears that if the JQuery or JavaScript is in the Source file for AllFiles.aspx it will not ever find these button, because they are in the full html version of the source, not AllFiles.aspx. I could manually run the Jquery in Google Chrome Debugger and have it work, but could not figure out how to make it run from inside of AllItems.Aspx as in #1, but the CSS works!