Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jeroen Breuer 4907 posts 12263 karma points MVP 4x admin c-trib
    Jan 07, 2016 @ 11:57
    Jeroen Breuer

    Svg files in the media library


    I would like to know what's the best way to handle svg files in Umbraco. It seems that when you try to upload svg as an Image Media Type you'll get an error:

    You could handle svg as the File media type, but than you don't get a thumbnail preview. I prefer to have svg as the Image Media Type because it's for a project which is already quite far and we're using the Image Media Type everywhere.


  • Jon R. Humphrey 164 posts 455 karma points c-trib
    Jan 07, 2016 @ 12:27
    Jon R. Humphrey


    I can upload svgs to the media library and access the file in my document type via a media picker; however, this is not what you want as this a File Media Type, not an Image Media Type as you are already facing.

    I'd be interested in following up on this if you do find anything out though?

    James South might have some input based on his work with the ImageProcessor possibly?

    Sorry I couldn't be more help at this time.


    For future reference, I was able to add SVG to the Media Library by manually creating an SVG media type with the following properties exposed:

    • Name: SVG File
    • Alias: svgsrc
    • Type: Media Picker


    • Name: SVG Code
    • Alias: svgCode
    • Type: Textbox Multiple

    In my web.config I've verified the svg mime type is present:

      <remove fileExtension=".svg" />
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />

    This was based on the forum post: Selecting an SVG

  • Zukisa 2 posts 71 karma points
    May 17, 2019 @ 10:22


    I'm using Umbraco 7 and I'm unable to upload .svg files into the Media library in back-office.

    error when selecting svg files

  • Tyler Brown 62 posts 209 karma points
    Jan 08, 2016 @ 17:37
    Tyler Brown


    Looks like the image cropper does support SVGs so you could replace your umbracoFile alias on the image media type with a cropper. That will give you thumbnails in the backoffice. Is this what you are trying to accomplish?


  • Tajamal 81 posts 169 karma points
    Feb 24, 2016 @ 14:35

    I dont see it working when adding to document type. What you see is a small broken image with blue dot inside.

    and image is not showing. i am styling my svg through css so its no go to use img tag.

    any other good ideas?

  • Mathias Poulsen 18 posts 139 karma points
    Mar 02, 2016 @ 14:48
    Mathias Poulsen

    Bump on this.

    In my case we want to use Image Cropper everywhere instead of the media picker.

    But when i upload the SVG image, initially it shows in preview, and it saves without errors.

    However if i reload the node, the preview is gone and no data has been saved to my Image Cropper property.

  • Bipin Kataria 26 posts 57 karma points
    Jul 26, 2016 @ 02:17
    Bipin Kataria

    If you want thumbnail in Media section for SVG file, just add below code in umbracoSettings.config > Content tag:


    <!-- what file extension that should cause umbraco to create thumbnails -->



  • Saeed Hamed 1 post 72 karma points
    Apr 07, 2019 @ 06:22
    Saeed Hamed

    My case was that i am unable to choose the svg file in content and your answer solved the issue, Many Thanks.

  • Osman Coskun 157 posts 360 karma points
    Sep 06, 2019 @ 06:48
    Osman Coskun

    On Umbraco 7.14.0 preview of svg files was working . After upgarding to 7.15.2 preview became the file name and a file icon. Your solution solved the problem. Thanks.

  • Tomasz 22 posts 96 karma points
    Jan 30, 2019 @ 01:23

    Not sure if this is still relevant, but I managed to enable this recently in an Umbraco 7.6.1 project by removing the SVG from umbracoSettings.config line

    disallowedUploadFiles ...

    Hope it helps.

Please Sign in or register to post replies

Write your reply to: