views:

25

answers:

2

I have several relative paths in my ASP Classic application. I'd like to get a reference to the root directory of my particular application (since the root of the server is something different) for the purpose of setting paths.

Is there a way to do this?

+1  A: 

Have you tried

<%= Server.MapPath("/") %>
mathieu
A: 

I found a way to do it using some server variables. Can anyone vouch for any possible bugs this way?

function getRoot()


pathinfo=Request.ServerVariables("PATH_INFO")

Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "^(/\w*/).*"
' Pop up a message box for each match
getRoot = myRegExp.Replace (pathinfo, "$1")


end function
Caveatrob
You had 1 problem, with the regex, you now have 2 ;)
mathieu