Friday, February 25, 2011

Document Library File Type customization

I never realized until I suddenly thought of one missing thing in document library file type. Look at the image below and see what the difference between two documents uploaded is. One being word and other being PDF.



Yes, the icons. For the word document, we have the icon type, however for the PDF document; we do not have the icon. And the same is true for many other file types which are not registered for the association in SharePoint.

In this post, I am going to show you how to achieve this stuff, so that when we upload any file type, we actually come to know by looking in to Type column that what file type are.

Please make a note that you should take a backup and copy of anything that you change which is built in.


Open C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\IMAGES folder to see all icons used by SharePoint. Now all filetype icon has IC***.(gif|png|jpg) format and they are 16 *16 icons in size.


So first step that we will do is create one 16 * 16 icon of type PDF and save it to 12 hives IMAGES folder.



Now we need to make the associate that if the file’s extension is .pdf, then this image needs to be displayed in Type column of document library.

Open C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\XML

Open DOCICON.xml file and locate the end of Mapping keys and add mapping for pdf file type. You can find all built in association mappings for file type and icons here.



Reset the IIS and then check. You should be good to go.

No comments:




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com