Translate a filename to a URL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm currently building an application where I need to find the URL within the
current site of a full file path.

Basically what I'm looking for is the opposite transformation from
System.Web.HTTPContext.Current.Server.MapPath.

Jeff
 
This is difficult since you can have many apps in IIS using the same virtual
directory. The best you're going to get is Request.PhysicalApplicationPath
and combine that with the relative path to the file.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Actually, the scenario you suggest does the same thing as MapPath: given a
URL it gives you the absolute pathname. I'm looking for something that goes
the other way in the context of the current application.

Jeff
 
Back
Top