Physical path of file in cms 5 r2

Vote:
 

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
Vote:
 

 

UnifiedFile file = HostingEnvironment.VirtualPathProvider.GetFile(path) as UnifiedFile; Response.Write(file.LocalPath);
#26740
Dec 17, 2008 17:26
Vote:
 
Thank you! :)
#26741
Dec 17, 2008 17:35
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.