Physical path of file in cms 5 r2

Lise Engmo Eggum
Member since: 2007
 

Hi!

How can I get the physical path of pagefiles that are located outside the sites directory? I've been looking at the thread http://world.episerver.com/Forum/Pages/thread.aspx?id=12835 but the UnifiedFileSystem no longer exists in cms 5, and I can't find the appropriate way to do it in this version. Using the MapPath methods just adds the file's virtual path to the site's physical path, and that's not where the file is...

#26717 Dec 17, 2008 11:01
  • Per Bjurström
    Member since: 1999
     

     

    UnifiedFile file = HostingEnvironment.VirtualPathProvider.GetFile(path) as UnifiedFile; Response.Write(file.LocalPath);
    #26740 Dec 17, 2008 17:26
  • Lise Engmo Eggum
    Member since: 2007
     
    Thank you! :)
    #26741 Dec 17, 2008 17:35