Unable to display PDF files or MP4 videos in IE


Description

The following issues may occur in Internet Explorer when the HTTP range retrieval functionality is enabled for Sitecore media requests:

The HTTP range retrieval functionality is designed to enable web browsers to start displaying video or PDF files after downloading only a part of the file from the website, not the full version of it.

For more details, visit ttps://www.rfc-editor.org/rfc/rfc9110.html#name-range-requests

Solution 1

This solution fixes the issue by disabling HTTP range retrieval for all types of media files:

  1. Disable range retrieval for Sitecore media by modifying the Media.EnableRangeRetrievalRequest setting in the Web.config file as follows:
    <setting name="Media.EnableRangeRetrievalRequest" value="false" />
  2. Clear the Sitecore media cache by deleting files from the /Website/App_Data/MediaCache folder.
  3. Clear the browser cache and restart the browser.

Solution 2

This solution fixes the issue for MP4 files without disabling HTTP range retrieval for them. It also allows to disable HTTP range retrieval for PDF files only while keeping it enabled for other media files:

  1. Put the Sitecore.Support.368505.415156.dll into the /Website/bin folder.
  2. Open the web.config file and perform the following modifications of media request handlers. Change the following lines:
    <system.webServer>
       <handlers>
          <add verb="*" path="sitecore_media.ashx" type="Sitecore.Resources.Media.MediaRequestHandler, Sitecore.Kernel" name="Sitecore.MediaRequestHandler" />
    ....
    <system.web>
       <httpHandlers>
          <add verb="*" path="sitecore_media.ashx" type="Sitecore.Resources.Media.MediaRequestHandler, Sitecore.Kernel" />
    ....
    to
    <system.webServer>
       <handlers>
          <add verb="*" path="sitecore_media.ashx" type="Sitecore.Support.Resources.Media.MediaRequestHandler, Sitecore.Support.368505.415156" name="Sitecore.Support.MediaRequestHandler" />
    ....
    <system.web>
       <httpHandlers>
          <add verb="*" path="sitecore_media.ashx" type="Sitecore.Support.Resources.Media.MediaRequestHandler, Sitecore.Support.368505.415156" />
    ....
  3. Add the following setting to the <settings> section of the web.config file:
    <setting name="Media.DisableRangeRetrievalRequestMimeTypes" value="application/pdf" />
  4. Clear the Sitecore media cache by deleting files from the /Website/App_Data/MediaCache folder.
  5. Clear the browser cache and restart the browser.

Note: You can disable range retrieval for other mime types by adding them to the value of the Media.DisableRangeRetrievalRequest setting. For example, to disable range retrieval for both application/pdf and application/zip, set the value to "application/pdf, application/zip".