Tuesday, August 31, 2010

How to hide "upload multiple files" links for one subsite

If we need users to input all meta data for files during the uploading, we don't want them to upload multiple files into a document library at one time.  So we have to hide the "upload multiple files" link below:


It is not easy, because "upload.aspx" is a system page which inherited from a system master page.  But there is a quick fix. We can do it through javascript.


<SCRIPT Language="Javascript">
var strCurrentUrl = window.location.pathname;
//alert(window.location.pathname);
if (strCurrentUrl.indexOf('Extranet/_layouts/Upload.aspx') >= 0)
{
                var linkElement = document.getElementById('ctl00_PlaceHolderMain_ctl01_ctl02_UploadMultipleLink');
                if (linkElement != null)
                                linkElement.style.display = "none";
}
</script>


The reason that checking "Extranet/_layouts/Upload.aspx" string in current url, is because we only want this change to be applied to one sub site "extranet".

Please be careful, this block of javascript need to be added to the end of the file.


This is what we got.

To hide the menu item, I recommend to download and deploy an excellent free third-party feature  Toolbar Manager. Unfortunately we need to configure it for all document libraries manually.


This is what we got:


2 comments:

  1. With integrity, you have nothing to fear, since you have nothing to hide. With integrity, you will do the right thing, so you will have no guilt. See the link below for more info.


    #hide
    www.ufgop.org

    ReplyDelete
  2. This is the appropriate weblog for anybody who needs to search out out about this topic. You notice so much its nearly exhausting to argue with you (not that I truly would need…HaHa). You undoubtedly put a new spin on a topic thats been written about for years. Nice stuff, simply nice! free online casino slots

    ReplyDelete