Get the absolute server path(physical path) of file for thumbnail

Vote:
 

I am suck here.  I need to get the actual path of the image on the server from the unified file path.
I get this (/global/additionalImages/test.jpg) but i need the c:\vpp\123\123\123-123-123-123.jpg file.  Is there a way to do this.

Thanks in advance.
Joshua

#35592
Dec 16, 2009 17:28
Vote:
 

You can do like this, not sure if there is a smoother way of doing it.

EPiServer.Web.Hosting.UnifiedFile f = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(virtualPath) as EPiServer.Web.Hosting.UnifiedFile;
string path = f.LocalPath;

#35593
Dec 16, 2009 17:57
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.
* 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.