Developer forum

Forum » Development » Get absolute physical path to Files folder

Get absolute physical path to Files folder

Andrey Kozachuk
Reply

Hello, I want to open a file that is stored in DW from code. I have a relative path that looks like "/Files/...". But to open a file with StreamReader I need an absolute path.

I found value I need in UI in Management Center -> System -> System information-> File locations -> File location.

Is it possible to get this settings from code of notification provider?


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

You can use HttpContext.Current.Server.MapPath(virtual folder) to get the physical path (which I assume you need instead of the absolute path).

Hope this helps,

Imar

Votes for this answer: 1
 
Andrey Kozachuk
Reply

Thanks, it works:)

 

You must be logged in to post in the forum