Copied to clipboard

Flag this post as spam?

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


  • Rene Becker 5 posts 76 karma points
    Apr 18, 2019 @ 10:53
    Rene Becker
    0

    FileSystemProviders Section umbraco 8 to change media location

    Hi, Where is the FileSystemProvidersSection in umbraco 8? I wanna change the media location.

  • Dave de Moel 122 posts 574 karma points c-trib
    Apr 18, 2019 @ 11:44
    Dave de Moel
    101

    In Umbraco 8 you do this using a composer to create a custom physical file system instance.

    public class MediaComposer : IUserComposer
    {
        public void Compose(Composition composition)
        {
            composition.SetMediaFileSystem(() => new PhysicalFileSystem("~/CustomMedia"));
        }
    }
    

    More about composing you can read here: https://our.umbraco.com/documentation/Implementation/Composing/

  • Hugo Becerra 12 posts 82 karma points
    Aug 16, 2019 @ 10:05
    Hugo Becerra
    0

    Hi Dave,

    Is possible to use a network location as media folder with this method?

    Thanks!

  • Dave de Moel 122 posts 574 karma points c-trib
    Aug 16, 2019 @ 11:38
    Dave de Moel
    2

    You'll need to create a custom FileSystemProvider for that, which you can then set using above method:

    public class MediaComposer : IUserComposer
    {
        public void Compose(Composition composition)
        {
            composition.SetMediaFileSystem(() => new MyCustomFileSystem());
        }
    }
    

    Though if your network location is the Azure Blob storage you can use the following: https://our.umbraco.com/documentation/Extending/FileSystemProviders/Azure-Blob-Storage/

  • Hugo Becerra 12 posts 82 karma points
    Aug 16, 2019 @ 13:25
    Hugo Becerra
    0

    Ok, then I have to create a totally new class to handle images because the existing one doesn´t support network locations? Wow, a lot of work.

    Thanks for your help!

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Sep 05, 2019 @ 00:20
    Alex Skrypnyk
    0

    Hi Dave,

    Do you know what to do with already uploaded images into /media folder?

    Thanks,

    Alex

  • Dave de Moel 122 posts 574 karma points c-trib
    Sep 05, 2019 @ 07:48
    Dave de Moel
    1

    I have never ran into a situation where reuploading wasn't an option, But I guess if that isn't an option, just uploading the folders in the media section to the remote storage should work if you use the virtual path provider, as the internal relative url's in Umbraco don't change then.

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Sep 20, 2019 @ 21:24
    Alex Skrypnyk
    0

    Hi

    Thanks for your input on how to change the root media folder. It works for me. But I still have a problem with image thumbnails that were uploaded to the custom media folder.

    enter image description here

    Thumbnails are broken in Umbraco 8.1.3.

    Exception says:

    File '/media/gepjronu/poster.jpg' is outside this filesystem's root.
    

    Image calling - /umbraco/backoffice/UmbracoApi/Images/GetBigThumbnail?originalImagePath=%2Fmedia%2Fgepjronu%2Fposter.jpg&rnd=0.5137560516892847

    what is wrong I suppose.

    Thanks,

    Alex

  • Lloyd White 3 posts 73 karma points
    Nov 26, 2019 @ 16:26
    Lloyd White
    0

    I'm encountering the same issue - anybody have a fix?

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Nov 27, 2019 @ 22:26
    Alex Skrypnyk
    0

    Hi Lloyd White

    Which version of Umbraco are you using?

    Thanks, Alex

  • Lloyd White 3 posts 73 karma points
    Nov 28, 2019 @ 10:31
    Lloyd White
    0

    Hi Alex,

    I'm using Umbraco 8.3.0.

    Another thing we have found is that we cannot select any images that we upload with a media picker with "Pick only images" enabled. The only place you can click is name of the image which then seems to navigate inside it as if it is a folder. Uploaded Images "Inside" Icon.png

  • Dan 43 posts 72 karma points
    Mar 18, 2020 @ 12:30
    Dan
    0

    Hi, Did you manage to solve this issue?

    I think I have just ran into it. I'm using 8.5.5 Created a new PhysicalFileSystem composition that points to a network drive and after I upload an Image, I can't select the image in the cms. It treats the image like a folder, even though the type says Image.

  • Dan 43 posts 72 karma points
    Mar 18, 2020 @ 16:16
    Dan
    0

    So to future Dan... This seems to happen when changing an existing site. The new image path doesn't get written to the umbracoMediaVersion table. The way I solved my issue was a bit drastic. I just deleted everything in App_Data/TEMP and reloaded the site and it was working fine.

  • Gurumurthy 54 posts 127 karma points
    Jan 29, 2021 @ 13:36
    Gurumurthy
    0

    Hi Dan,

    Can you help me with mapping the media folder to an network drive..

    How this can be achieved.

    Thanks, Gurumurthy J V

  • ibrahim TUNC 55 posts 133 karma points
    Nov 10, 2022 @ 11:11
Please Sign in or register to post replies

Write your reply to:

Draft