Tuesday, September 30, 2014

Add FileType Icons in SharePoint

Sometime when you upload a file in document libraries and icon doesn’t appear in 'Type' column. That is because SharePoint does not provide icons for all kinds of FileTypes. However SharePoint is flexible enough that you could add a new icon for missing FileType.

Note: You need to perfrom these steps on each Web Server you have. for SharePoint 2013 these changes made in 14hive not 15hive.

To add Icon you need to find or create an icon for that FileType (16 x 16 Pixel gif or png) and copy it to
..Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES (for SharePoint 2013 as well not in 15hive)
Next step is to edit Docicon.xml ( don't forget to take the backup of Docicon.xml before edit). This file is present in
..Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
Search for <ByExtension> section and add an entry for file extension of the application like this 
<Mapping Key="zap" Value="iczap.gif" />
Do IISReset. 
You should see the Icon now. HTH..

Thursday, September 18, 2014

Extract WSPs from Central Admin Solution Management

You can extract wsps from Central Admin Solution Management using PowerShell if you don't have binary or Setup exe.

$wsps = "Solution1.wsp;Solution2.wsp"
$path = "D:\Wsps\"

$farm = Get-SPFarm
$wspNames = $wsps.split(";",[StringSplitOptions]'RemoveEmptyEntries')
foreach($wspName in $wspNames) {
$file = $farm.Solutions.Item($wspName).SolutionFile
$file.SaveAs($path+$wspName)
Write-Host "Solution File extracted to this location " + $path$wspName
 }