Enhance Document Libraries with Custom Document Type Icons
With SharePoint being such a fluid platform it’s easy to extend the capabilities of something like a simple document library to really integrate with your everyday business process. That said, in a media production or design environment many of the file types used just show up as the default “paper” icon. In this article I’ll walk through the process of adding additional document type icons to SharePoint.
Prerequisite: This solution requires access to the physical server and permissions to reboot IIS.
To get started, we need to determine what file types we want to add icons for and as applicable, if there are any default icons definitions that we want to change. As an example, SharePoint uses a generic icon for .png files, but I’d really like the Fireworks icon to be used, so we’ll need to change the default definition for that type. Once we’ve determined what icons we need, we need to gather those icons and make 16px square GIF files for each one. SharePoint’s naming lexicon uses icXXX.gif where XXX is the extension of the file type the graphic represents (ie: icbmp.gif for a BMP, icdocx.gif for DOCX).
Once you’ve got your icons put together it’s time to move them to the server and make the necessary changes to the server.
Depending on your SharePoint installation, you’ll work in one of the following paths:
Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\Template
Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\60\Template
Inside the parent template folder, you should see a folder called Images, which contains all of the default SharePoint graphics (including the default icXXX.gif files). Drag your new icon graphics into this folder. Once the transfer is finished, we can edit the XML file that ties actual file extensions to a specific icon graphic. Inside the file path above, browse the XML folder and open up DOCICON.XML in your preferred text editor.
In the “ByExtension” section of the XML structure you’ll notice that there’s a mapping definition for each type of file extension. If you want to change the graphic that one of the existing types points to, you can edit it here. For example, .psd files by default use the icbmp.gif graphic, but I want it to show my psd graphic, so I can edit that file reference here.
For new definitions, I prefer to work at the bottom of the file. Some people may prefer to keep them alphabetical, but I like to know which ones I’ve added, so I always make my changes at the bottom. Insert new mappings as shown below for each type you wish to add. Once you’ve finished editing DOCICON.XML, save and close the file.
<Mapping Key=”extension” Value=”icXXX.gif” />
As an example, let’s say we want to add a new entry for PDF files:
<Mapping Key=”pdf” Value=”icpdf.gif” />
All that remains now is to restart IIS on the server in order to allow these changes to take effect. For those of you unfamiliar with this, note that when this happens your server will be inaccessible to your users for a couple minutes.
Click Start -> Run, type in the following command and hit enter:
iisreset /noforce
Note that you can run iisreset without the /noforce switch, however in a production environment /noforce is a nice idea as it prevents the server from abruptly terminating the service if a graceful shutdown fails. Once IIS comes back online, you can access your site and see your new icons.
Before:

After:





