Try our conversational search powered by Generative AI!

EpiServer 6 - PageFiles absolute path


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

Sep 25, 2013 15:45

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;


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.