- Install the corresponding program on the computer and associate the file with this program (ie: acrobat reader for .pdf files). This option is maybe not an option for the production server.
- Associate the file extension in the operating system. Open "Control Panel -> Folder Options-> File Types -> New -> Add file Extension" then register the icon for this extension (Advanced -> Change Icon)
- Associate the Icon with the file extension in your web.config. Add thumbnails generator for the known file type. For example for PDF file type:
<mediaType name="PDF file" extensions="pdf"> <mimeType>application/pdf</mimeType> <forceDownload>false</forceDownload> <sharedTemplate>system/media/unversioned/pdf</sharedTemplate> <versionedTemplate>system/media/versioned/pdf</versionedTemplate> <thumbnails> <generator type="Sitecore.Resources.Media.MediaThumbnailGenerator, Sitecore.Kernel"> <extension>png</extension> </generator> <staticFile>Path where the icon is located. For example /sitecore/shell/Themes/standard/images/pdf_icon.png</staticFile> </thumbnails> </mediaType>
After these modification, clear the cached files:
- Open the folder "/Temp" under the Sitecore root.
- Delete all files with the name "fileicon.....".
- Clear media cache "/App_Data/MediaCache" under the Sitecore root.
Excellent! Thank you!
ReplyDelete