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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.