1

When I tried to upload a pdf file in Media library I am getting chrome symbol as icon instead of pdf icon. I tried in vanilla instance where everything works fine. I checked the template's icon and it is correct. I found that the icons are coming from physical location (sitecore/shell/themes). Please help me in identifying where the mappings happens to fix the issue. Sitecore version - 8.2 update 5

5
  • 3
    don't waste your time with such a minor thing Commented Apr 4, 2018 at 7:24
  • 2
    :) But my client is asking to fix..
    – Anjo
    Commented Apr 4, 2018 at 7:27
  • vanilla solution and solution with pdf issue is on same computer? Commented Apr 4, 2018 at 7:45
  • Both are in different computer. The pdf issue is happening on our SIT server. I tried the same solution in my local (same code as SIT) and its not reproducible. i.e correct pdf icon is coming in my local.
    – Anjo
    Commented Apr 4, 2018 at 8:27
  • 1
    In our case there was a wrong order of processors in the icon pipeline. The GetIconFromSystemFileAssociation was first, but I guess it shoul be last: Sitecore.config <getFileIcon> <processor type="Sitecore.Pipelines.GetFileIcon.Processors.GetIconFromMediaTypeConfiguration, Sitecore.Kernel"/> <processor type="Sitecore.Pipelines.GetFileIcon.Processors.GetIconFromItem, Sitecore.Kernel"/> <processor type="Sitecore.Pipelines.GetFileIcon.Processors.GetDefaultIcon, Sitecore.Kernel"/> <processor type="Sitecore.Pipelines.GetFileIcon.Processors.GetIconFromSystemFileAssociation, Sitecore.Kernel"/> </getF Commented Jul 19, 2018 at 16:56

2 Answers 2

5

The reason is that Siteore use the associated icon from the OS. Acrobat Reader is installed on your laptop, not on your SITserver. So the SIT server displays a default icon instead.

You can specify which static file to use for which extension in the web.config. To add the PDF icon, do the following:

Download a .pdf icon from the Adobe Website (due to licensing restrictions, Sitecore is not shipped with an Acrobat Reader icon). Place the icon wherever you wish.

Go to Sitecore.config file and modify media 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>
  <!-- New section -->
  <thumbnails>
    <generator type="Sitecore.Resources.Media.MediaThumbnailGenerator, Sitecore.Kernel">
      <extension>png</extension>
    </generator>
    <staticFile>File location. For example /sitecore/shell/Themes/pdficon_large.png</staticFile>
  </thumbnails>
  <!-- end:New section -->
</mediaType>

Clear the folders:

  1. /temp/ folder (at least all files named “fileIcon”)

  2. The Sitecore media cache (default located at /app_data/mediacache/)

  3. Clear your browser cache.
  4. Restart the website.

More information you can find here: https://briancaos.wordpress.com/2013/01/10/sitecore-media-library-missing-pdf-icons/

2
  • Tried installing reader in server but didn't worked as expected. Then I followed the 2nd approach and it got worked. Hence accepting the answer.
    – Anjo
    Commented May 14, 2018 at 12:41
  • "due to licensing restrictions, Sitecore is not shipped with an Acrobat Reader icon" - This is not (entirely) true. There is a PDF icon included with Sitecore; it's located at /-/icon/WordProcessing/16x16/imp_exp_pdf.png
    – Peter
    Commented Aug 6, 2021 at 8:59
0

Expanding upon a comment, we opted to change the order Sitecore processes the icon.

The patch file to do so would look something like this:

<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <pipelines>
            <!-- Change the order of how Sitecore gets the icon so that it checks Sitecore before the system. -->
            <getFileIcon>
                <processor type="Sitecore.Pipelines.GetFileIcon.Processors.GetIconFromSystemFileAssociation, Sitecore.Kernel">
                    <patch:delete />
                </processor>
                <processor type="Sitecore.Pipelines.GetFileIcon.Processors.GetIconFromSystemFileAssociation, Sitecore.Kernel" />
            </getFileIcon>
        </pipelines>
    </sitecore>
</configuration>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.