November Happy Hour will be moved to Thursday December 5th.

EpiServer 6 - PageFiles absolute path

Vote:
 

I'm new in episerver, and I have a issue for PageFiles subdirectories
I must get the absolute path on this directories, but I can get only path for PageFiles like this:

EPiServer.Web.Hosting.VirtualPathVersioningProvider p = EPiServer.Web.Hosting.VirtualPathHandler.GetProvider("SitePageFiles") as EPiServer.Web.Hosting.VirtualPathVersioningProvider;
            string paths = p.PhysicalBasePath.FullName;

but I want to get path like this C:\EpiServer\VPP\PageFiles\77\ae\77ae343-34543.pdf

#75344
Sep 25, 2013 15:45
Vote:
 

I think a line in your question was lost(?), but you should be able to get the local path like this:

UnifiedFile file = HostingEnvironment.VirtualPathProvider.GetFile(path) as UnifiedFile;  
string filePath = file.LocalPath;

    

#75504
Sep 27, 2013 9:06
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.