Copied to clipboard

Flag this post as spam?

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


  • Paul Seal from codeshare.co.uk 356 posts 1872 karma points MVP 2x c-trib
    25 days ago
    Paul Seal from codeshare.co.uk
    0

    SVG media files not loading from Azure Blob Storage

    Hi all

    I have a site which is storing the media files in blob storage. This is working fine for normal images.

    I also have some SVG files in the media section, which are not loading, and in the console I get a 404 for each SVG.

    Failed to load resource: the server responded with a status of 404 ()
    

    The normal images in the media section load fine, it's just SVGs.

    Strangely, if I delete the Web.config file from the media folder in my solution, it then works, so there must be something about the handlers in this config which is preventing the SVGs from loading.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <handlers>
          <clear />
          <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
        </handlers>
      </system.webServer>
    </configuration>
    

    Does anyone know how I can resolve this please, without deleting the web.config file from the media folder?

    Thanks

    Paul

  • Jeavon Leopold 2996 posts 13114 karma points MVP 6x admin c-trib
    25 days ago
    Jeavon Leopold
    101

    Hi Paul,

    For Umbraco v7.5+ you need to add a StaticFileHandler to media/web.config also otherwise the VPP won't work.

    It should look like

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <handlers>
                <clear />
                <add name="StaticFileHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.StaticFileHandler" />
                <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
            </handlers>
        </system.webServer>
    </configuration>
    

    More information and this config and the VPP can be found at https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure#virtual-path-provider

    Jeavon

Please Sign in or register to post replies

Write your reply to:

Draft