Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Oct 19, 2017 @ 03:37
    Tom
    0

    UmbracoFileSystemProviders.Azure - Server.MapPath

    Hi we're using azure blob storage but have a need to pull the file from disk to stamp it in to a PDF. Just wondering how to obtain a disk path for a given media file?

  • Kevin Jump 2309 posts 14673 karma points MVP 7x c-trib
    Oct 19, 2017 @ 08:47
    Kevin Jump
    2

    hi

    the best thing to do is to use the IFileSystem interface to access the media folder. this abstracts away the storage system underneath.

    see: https://our.umbraco.org/documentation/extending/custom-file-systems

    you get the media folder with :

    IFileSystem fileSystem = FileSystemProviderManager.Current.GetUnderlyingFileSystemProvider("media");
    

    and one you have that you can do most of the same things you can with System.IO. except it will happen wherever your media is stored.

  • Tom 713 posts 954 karma points
    Oct 19, 2017 @ 21:59
    Tom
    0

    Thanks Kevin!

Please Sign in or register to post replies

Write your reply to:

Draft