0

I used HttpContext.Current.Server.MapPath("~/Images/abc.jpg") to get the Windows Path for a file in my web application.

Now I want the reverse. From the windows path that I got, I want to get the web path that I had earlier passed as parameter to Server.MapPath. How to get it?

2

1 Answer 1

1

windowsPath.Replace(Request.ServerVariables["APPL_PHYSICAL_PATH"], String.Empty);

Found this at: Absolute path back to web-relative path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.