Copied to clipboard

Flag this post as spam?

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

  • Nathan 10 posts 80 karma points
    May 20, 2016 @ 08:43

    Upload Media files to Folder Extend

    Hi everyone, i want to move Media folder to a another place in IIS and change upload function to upload files to this Folder, and URL auto general by Umbraco is redirect to this Media folder.

    I had research and i see Umbraco just support upload Media files to Azure or Amazon, but don't see for a server.

    Thank everyone. Sorry about my bad english.

  • Ben Abbott 19 posts 124 karma points
    May 20, 2016 @ 10:09
    Ben Abbott

    You could try editing ~/Config/FileSystemProviders.config

    You want to change this section..

    <Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core"> 
             <add key="virtualRoot" value="/media/" />   
    < /Provider>

    Remove the virtual root parameter and then add the following two new parameters

     <add key="rootPath" value="<UNC Path to new media folder>" />     
     <add key="rootUrl" value="<URL to new media folder>" />   

    The “rootPath” specifies a Windows filesystem path where Umbraco can save uploaded files. It’s a standard Windows file path (not a URL path).

    The “rootUrl” is the URL that Umbraco will prepend to the media filename when rendering pages to browsers.

    Hope this helps


  • Bill Haggerty 43 posts 177 karma points
    Jun 24, 2016 @ 18:46
    Bill Haggerty

    I have made the modification to FileSystemProviders.config, but I don't understand what is going on with the key "rootUrl".

    Here is my modification of rootPath :

    <add key="rootPath" value="\\MACHINE_NAME\sharedfiles" />
    and then
     <add key="rootUrl" value="???" />

    what goes where I have "???" -- I have tried various paths, just the tilde character, etc. I would really appreciate an explanation of the "rootUrl" key works. Thanks !!!

  • Simone Chiaretta 134 posts 541 karma points c-trib
    Oct 21, 2016 @ 07:25
    Simone Chiaretta

    You might have found the solution by now, but I encountered the same problem and wanted to share my solution.

    Basically, relative urls are stored in the database in the umbracoPath property of the media item, so if you change the rootUrl property it will only apply to newly uploaded files. Old files will still remain under the old path, so if you move them to the new path, nothing will work anymore.

    That why you still see the files you have under the standard /media/ url.

    Solution is:

    1. change config
    2. move old media files to new path
    3. rename the relative url of all old media to the new url (in DB or using the MediaService

    HTH Simone

Please Sign in or register to post replies

Write your reply to: