Wednesday, May 18, 2011

How to Disable Multiple File Upload in SharePoint

Had to disable Multiple File Upload in SharePoint to enforce the users to enter mandatory Meta-data. 

OK, How to Disable Multiple File Upload in SharePoint?how to disable multiple file upload in sharepoint
Well, If we want to disable Multiple file upload feature in all SharePoint sites, There are 2 options available for us:
  1. Disable client integration
  2. Edit the files are mentioned below. (Yes, Its not supported by Microsoft!)
  • Navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES
  • Open the file: DefaultTemplates.ascx
  • Search for: <SharePoint:MenuItemTemplate and then delete the entire node, That is:
<SharePoint:MenuItemTemplate
    ID="MultipleUpload"
    Text="<%$Resources:wss,ToolBarMenuItemMuliUpload%>"
    Description="<%$Resources:wss,ToolBarMenuItemMuliUploadDescription%>"
    Sequence="200"
    ImageUrl="/_layouts/images/MenuUploadMultiple.gif"
    HiddenScript="!browseris.ie55up"
    UseShortId="true"
runat="server"/>

Now, We have to hide the link for multiple upload as in the below picture.
disable multiple file upload sharepoint
  • Navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS and open the Upload.aspx (In SharePoint 2010, its: UploadEx.aspx)
  • Search for:
      <TD>
           <asp:HyperLink id="UploadMultipleLink" runat="server"  ACCESSKEY=U Text="<%$SPHtmlEncodedResources:wss,upload_document_upload_multiple%>" onclick="javascript:return !LaunchPictureLibraryApp();"/>
      </TD>

  • Now, we are going to Hide the link for Multiple upload. So add the highlighted text
<TD style="display:none">
                    <asp:HyperLink id="UploadMultipleLink" runat="server"  ACCESSKEY=U Text="<%$SPHtmlEncodedResources:wss,upload_document_upload_multiple%>" onclick="javascript:return !LaunchPictureLibraryApp();"/>

Don't forget to do the IIS Reset!   
how to disable multiple file upload in sharepoint

How about disabling for a Particular site? say: for a site "Sales"
Yes, You can do that as well with little Javascript. Edit the Upload.aspx, Place the below code just before </asp:content>

<SCRIPT Language="Javascript">

var CurrentURL = window.location.pathname;

if CurrentURL.indexOf('Sales/_layouts/Upload.aspx') >= 0)
{
          var MultipleUploadlink = document.getElementById('ctl00_PlaceHolderMain_ctl01_ctl02_UploadMultipleLink');
             if (MultipleUploadlink != null)
                                MultipleUploadlink.style.display = "none";
}
</script>


How to Disable Multiple File Upload in SharePoint in SharePoint 2010? 

For SharePoint 2010,  Set these elements to hidden either in your master page or wherever applicable!
#ctl00_PlaceHolderMain_UploadDocumentSection_ctl03_UploadMultipleLink
\.Documents\.New\.AddDocument\.Menu\.Upload\.UploadMultiple-Menu32
{
display: none
}

Want to disable ONLY to a particular document Library?
Just place a content editor web part and place this code buddy!

Updated: Edit the content editor webpart by clicking inside.
how to disable multiple file upload in sharepoint 2010

Under the tool bar, click on "Edit HTML Source" and then Place the below code in HTML Source window.
disable multiple file upload sharepoint 2010

<style type="text/css">
#Ribbon\.Documents\.New\.AddDocument\.Menu\.Upload\.UploadMultiple-Menu32
{
    DISPLAY: none;
}
</style>

Cool!

If you want to hide the Upload Button altogether:
<style type="text/css"> 
#Ribbon\.Documents\.New\.AddDocument-Large
{     
 display:none !important; 
} 
</style>

Using Toolbar Manager (http://features.codeplex.com/) from Codeplex is an another option!

Tail: If your Multiple upload option is disabled and you want to find a solution, try my post: Why "upload multiple documents" is Disabled? How to Resolve it?
If you want to hide SharePoint 2010 Ribbon's Tab/Group/Button/Menu with features, Refer: How to Hide SharePoint 2010 Ribbon Tab - Group - Button - Menu



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

13 comments :

  1. Nice!. But doin so will affect all the sharepoint sites. what if i want to do it for a single site?!.. Any Ideas?!.

    ReplyDelete
  2. Yes Dude, You can use the above trick to disable multiple file upload for a particular site!

    ReplyDelete
  3. Wonderful article Mate! Enjoyed reading...

    ReplyDelete
  4. Where should be the Content Editor web part palced?

    ReplyDelete
  5. Put the content editor below the library. What wasn't explained is you need to put the code in a text file somewhere and then link to that text file using the "Content Link" field of the Content Editor web part settings box (on the right where you can change appearance, layout, etc). The actual content editor should be blank just linking to the text file with that code.

    ReplyDelete
  6. Jeff,

    You can directly place the code inside content editor webpart. Not necessary to put into a text file and then point to it. I've updated the post with detailed instruction now.

    ReplyDelete
  7. how to disable multiple file upload to a particular document library in sharepoint 2007

    ReplyDelete
  8. sharepoint 2010
    added the content editor and it did hide the upload multiple documents in the tool bar, but how do you hide the mulitiple documents link on the add document popup screen?

    ReplyDelete
  9. Hello,
    how to disable multiple file upload to a particular document library in sharepoint 2007 AND we have custom MultiFileUpload page using Rad Controls which will also allows to update the document metadata means Additional fields and we need to disable the OOB MultiFile Upload for some Document Libraries and replace with the Custom FileUpload page which was developed using RadControls. can u please give me a solution.

    ReplyDelete
    Replies
    1. Find the Tag ID/Class for the upload control, Hide it with CSS trick explained above!

      Delete
  10. Great Post!

    I am trying to prevent multiple uploads from a SPS 2010 Picture Library. In the picture library the multiple file upload option appears in the picture library slide show web part tool bar. Any suggestions as to how to disable\hide the function in the tool bar?

    ReplyDelete
  11. The above code is not working for me.how to disable multiple file upload to a particular document library in share point 2010? kindly gimme any solutions

    ReplyDelete
    Replies
    1. For SharePoint 2010, Use this method: http://www.sharepointdiary.com/2013/06/how-to-hide-sharepoint-2010-ribbon-tab-group-button-menu.html

      Delete

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...