Avoiding the "Add a listing" page when uploading documents to the Portal

This is certainly a frequently asked question (in fact I’m writing this as I just had it asked via the blog here).

The basic gist of the problem is this. When you “Upload a document” within a portal area you are presented not only with the “Upload Document” page below:

Upload Document

But immediately after it the “Add Listing” page below:

Add Listing

The reason for this is that by default the “Add a listing for this document” is checked (see first diagram). Unfortunately there is no way to change this default without some customisation, so below I present two possible solutions. Remember this IS a customisation, and therefore all the standard disclaimers apply. (I’m actually working on a post that sets out some customisation common sense, but in the meantime, you know what they are!)

The start is common to both approaches, and that is to ensure you are modifying the correct “Upload.aspx” file, there is actually one for each template. To help identify which template you should modify I’m going to refer to my earlier post here:
https://blogs.msdn.com/danielmcpherson/archive/2004/05/23/139886.aspx 

Specifically, the section that desribes which template each of the folders under:
Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\<Locale ID>\
relate to.

Once you have found and opened the correct “Upload.aspx” file chose one of the following two approaches:

1. Remove the “Add a listing for this document” control from the Upload.aspx page.
This approach basically involves removing the Server control responsible for rendering the Checkbox, to do this follow the below steps:

a) Search the file for the following string: <SPSWC:SubmitLinkOnSTSUploadDocPage runat=server />

b) Delete it.

c) Save and exit notepad.

Done. From here on the “Upload a document” page with no longer have the “Add a listing for this document” and therefore will not display the corresponding web page.

No add listing

2. Set the default checkbox value to unchecked.
This approach involves adding some javascript that flips the value client side when the page loads.

a) Find the following tags at the bottom of Upload.aspx:
</BODY>
</HTML>

b) Insert the following immediately above them:
<script language='javascript' for='window' event='onload'>
document.all.submitlst.checked=false;
</script>

c) Save and exit notepad.

Done. Now the checkbox will default to unchecked.

Unchecked

A final note, if either of these approaches don’t work, then it may be because you have modified the “Upload.aspx” page previously in FrontPage, it has therefore become “unghosted”. If this is the case you should make the above changes using FrontPage instead of notepad as I described.

I suspect there are many other options out there, so share away folks, it’s what the comments are for!