Copied to clipboard

Flag this post as spam?

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


  • Ask 13 posts 83 karma points
    Aug 22, 2024 @ 23:10
    Ask
    0

    converting urls in media table to relative

    Hi, I have a umbraco 10.8.6 installation with azure blob storage for images.

    I have a problem that some of the urls in the umbraco database table umbracoMediaVersion are relative, and some are absolute.

    The absolute url is pointing to the blob storage container that I have configured.

    The reason it is like this, is because the project was upgraded from umbraco 8, and in that, the urls were made relative.

    But, I now need them to be relative, as the full urls make me lose the ability for cropping when calling the images.

    I there a way to make the images I have in my database go from being absolute to relative?

    What I've tried

    I tried one approach which was to simply write a sql script to the database where I deleted all the blob storage domains in the umbracoMediaVersion table.

    So for example, this url:

    https://stfTestUmbraco.blob.core.windows.net/media/rendwlam/picture.jpg

    Was simply replaced in the database with

    /media/rendwlam/picture.jpg

    But, as soon as I in backoffice save the image again, it goes right back to it's old url.

    How do I fix this?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies