Pages

Tuesday, October 2, 2012

Disable Multiple File Upload on SharePoint 2007

Sometimes you have to prevent users from uploading multiple files into a document library. For example, you have a custom Edit form and you don't want users to bypass it which is what SharePoint allows them to do when uploading multiple files, even if some fields in a document library are mandatory.

I thought it's an easy task as there is the Upload.aspx file in the Forms folder in each document library. That file has a JavaScript function responsible for multiple file uploads, so you can easily edit that and make it behave as you like. Wrong!

The thing is that Upload.aspx seems to be never used in reality as SharePoint will keep redirecting you to the _layouts/Upload.aspx page, which in its turn can be edited as well, but resides on the server and changes to it would affect the whole farm. This post has more details on why this is happening. 

I've spent some time searching for a solution and the easiest I've found was to amend site's CSS to hide unnecessary controls.

All you have to do is to add the following lines into the file:


.ms-splitbuttondropdown, #ctl00_PlaceHolderMain_ctl01_ctl02_UploadMultipleLink {
display: none !important;
}

The cool thing is that this will not only remove the Upload multiple files link from the upload page, but will also disable the feature within a document library. And it applies on a site level only, so you can leave the rest of your farm intact.

You can achieve the same by other means, but they all about code and amending server files which is not usually acceptable on a large farm.

Monday, October 1, 2012

Changing sub-site URL

A common request to SharePoint administrators in big companies with large collaboration environments is to change the URL of an intranet site. Although not a big job in theory, in practice it becomes a nightmare for anyone looking after a farm with thousands of site collections, not to mention individual sub-sites!

If sites are self-provisioned or there is a request form anyone can use, then it's typical that users choose addresses similar to site titles which, unfortunately, change from time to time, mostly due to organisational changes.


I used to say "no" to such requests and we even have put governance in place to restrict changing URLs, so only business critical changes could be progressed. But recently a colleague of mine found an out of the box feature that some SharePoint administrators may be forgetting about.

The thing is that you can easily change the URL of any sub-site from Site Settings > Title, Description, and Icon. This page gives you the option to change the address online!

Change Sub-Site Address


Changing the address take a second or few as it the actual site is not moved and its GUID remains the same. It's just the address being changed like a property.

This works on 2007, 2010 and 2013. The funny thing is that there is no such option for a site collection and that's why I thought the same is for sub-sites.