Copied to clipboard

Flag this post as spam?

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


  • Kasper Hansen 3 posts 83 karma points notactivated
    Sep 10, 2019 @ 10:01
    Kasper Hansen
    0

    FileSystemProviders - Media in different folder

    Is it possible to configure, where to store media items in U8?

    Im looking for somethimg simular to this configurations:

    https://our.umbraco.com/documentation/reference/config/filesystemproviders/

     <?xml version="1.0"?>
    <FileSystemProviders>
        <!-- Media -->
        <Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
            <Parameters>
                <add key="virtualRoot" value="~/media/" />
            </Parameters>
        </Provider>
    </FileSystemProviders>
    
  • Jonathan Distenfeld 105 posts 618 karma points
    Sep 10, 2019 @ 11:08
    Jonathan Distenfeld
    100

    Hi Kasper,

    in Umbraco 8 you will have to use Composer to achieve this:

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

    Found this here: https://our.umbraco.com/forum/umbraco-8/96889-filesystemproviders-section-umbraco-8-to-change-media-location

    You can find out more in the docs: https://our.umbraco.com/documentation/Implementation/Composing/

    ~ Jonathan

  • Kasper Hansen 3 posts 83 karma points notactivated
    Sep 17, 2019 @ 12:14
    Kasper Hansen
    0

    Thanks - spot on :)

    If one where to locate the media on a shared server, is that the same implementation with different path?

  • Ahmad Shabeeb 2 posts 22 karma points
    May 20, 2020 @ 08:33
    Ahmad Shabeeb
    0

    They say in the docs to fix it with Composer

    But where do you add the file containing the code?

    Why the docs are so short and not enough

  • 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