.svg file is not displaying in SharePoint 2019 on premise

Shaiju Kumar 96 Reputation points
2020-08-05T19:52:57.953+00:00

I am trying to add an svg file in SharePoint 2019 on-premise content editor web part but it is not displaying. It is working in previous versions of SharePoint.

Please find attached error screen and HTML script

16013-html.png

15989-output.png

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,576 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,834 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shaiju Kumar 96 Reputation points
    2020-08-06T08:03:56.403+00:00

    SharePoint was retuning svg content type as "application/octet-stream" instead of "image/svg+xml"

    Solution:

    The issue can be resolved by installing the IIS 6 Metabase Compatibility windows feature either through Server Manager UI or using the following PowerShell commands:

    import-module servermanager
    install-windowsfeature web-metabase

    This will also resolve other css mime issues

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Amos Wu-MSFT 4,051 Reputation points
    2020-08-06T02:01:05.043+00:00

    You could open the SVG file in a text editor(I use VS code),then copy and paste the content of the SVG in text editor to the Script Editor web part.


  2. Evans Zhang 1 Reputation point
    2020-08-06T07:18:45.907+00:00

    Try opening up your F12 Developer Tools and checking either the document mode dropdown. Switch the mode to "Edge" .

    If it's worked , you may need add html meta http-equiv="X-UA-Compatible" content="IE=edge" to your master page

    0 comments No comments