1

For a particular document library I need to navigate to a custom page when I click on the upload button in the toolbar. For other libraries I need the default upload as it is.

Any ideas?

4 Answers 4

2

Use a custom action feature to amend the toolbar. The following attributes should override the default (reference: rendering template ToolbarUploadMenu in DefaultTemplates.ascx):

Location="Microsoft.SharePoint.StandardMenu"
GroupId="UploadMenu"
ID="Upload"
Sequence="100"

To bind to your particular document library use a specific content type on it and reference that in the definition for the custom action.


If the above doesn't work, still add the new toolbar button with a custom action but hide the existing upload with JavaScript. Here's a (verbose) example to hide the Upload using jQuery:

var newMenuTd = $('td.ms-toolbar > span > table[id*=NewMenu]').closest('td.ms-toolbar');
var newMenuSeparator = $(newMenuTd).next();
var uploadTd = $('td.ms-toolbar > span > table[id*=UploadMenu]').closest('td.ms-toolbar');
var uploadSeparator = $(uploadTd).next();
if (uploadTd.length > 0) {
    newMenuSeparator.empty();
    newMenuTd.empty();
    uploadSeparator.empty();
    uploadTd.empty();
}

Note that future SharePoint revisions may break this JavaScript and it won't be as efficient or elegant as the first solution.

2

You need to use SharePoint designer to create a custom list view.

here are some links to get you going: http://office.microsoft.com/en-us/sharepointdesigner/HA101191111033.aspx

http://blah.winsmarts.com/2007-5-Customize_the_-and-quot;NewFormaspx-and-quot;_page_for_a_SharePoint_List.aspx

2
  • Just a nitpick, you need to create a custom list form for the upload form for the list, not a custom view. Sep 13, 2009 at 21:04
  • To nitpick further, this will not work for the original question. You cannot set a custom upload page this way for a Document Library (only Lists), but you can set a custom edit page (after uploading you'll be redirected to something like EditPage.aspx?mode=Upload )
    – DaveD
    Sep 27, 2011 at 15:19
2

Maybe you will find my solution somehow useful - Custom upload form for document library in SharePoint 2010 - programmatic approach. It's a full programmatic server side solution, it does not require any javascript tricks, it can be applied selectively to specific Document Libraries based on custom list templates (no need to change the default behaviour on entire WFE) and it is quite simple.

1
  • Went through the blog post and it worked as advertised. Using the linked to code helped as well. Big Thanks.
    – RWL01
    Oct 4, 2012 at 20:27
1

Have a look at this article. It describes creating your own upload.aspx, but looking at the article briefly, this will change the upload location for ALL libraries. You might want to create your own doc lib tempalte and associate the new3 upload page with that specific upload page .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.