One of our customers wanted a way to *uncheck* the “Overwrite existing file” option by default. For better understanding, here’s what it is:
1. Open a team site in WSS V3.
2. Navigate to a document library.
3. Choose the *Upload* option to upload a document.
4. Here you'll see that the "Overwrite existing files" option is selected (*checked*) by default.
Well, if you have to do this in WSS V2, the procedure is pretty lengthy…
1. Open <Install Drive>:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\SPSTOC\LISTS\DOCLIB
2. After backing up the Schema.xml file, pop it open and look for the below tag:
1. <INPUT type=hidden name="putopts" id=putopts value="true">
3. Change value="true" to value="false"
4. And then find the below line in the same file (~ 7-8 lines down the line):
1. <INPUT TYPE=CHECKBOX name="overwrite" id=overwrite value="true" CHECKED DEFANGED_Onclick="setputopts()" tabindex=1 title="]]><![CDATA[Overwrite]]><![CDATA[">
5. Delete the word CHECKED from the above line.
6. Save the Schema.xml file.
After an IISRESET, the “Overwrite existing file” option should be unchecked by default for all document libraries.
In MOSS 2007/WSS V3, however, to do the above is quite simple. All that we need to do is to make a small modification to the *Upload.aspx* file located under: <Install Drive>: \Program Files\Common Files\Microsoft Shared\web server extensions\12\template\layouts.
Open the upload.aspx file and look for the following tag:
<asp:CheckBox id=”OverwriteSingle” Checked=”true” Text=”<%$Resources:wss,upload_document_overwrite_file%>” runat=”server” />
Change Checked=”true” to Checked=”false”. Really simple indeed isn’t it? Due to the fact that WSS V3 & MOSS 2007 is tightly integrated with ASP.NET 2.0 framework, most of such functionality is controlled through application pages instead of schema.xml files as in the previous version.
Well, if there’s a requirement for such cosmetic changes, you could look out for ASPX files. However, PLEASE NOTE: modifying any OOB (Out Of the Box) files is unsupported, so it’d be a good idea to keep a backup of the files that needs modification. It’s also a good idea to keep a backup of the *modified* files, just in case you don’t miss the customizations if those files were to be overwritten by future patches.