Wednesday, February 15, 2006

 

Using ASP Server.MapPath

These yeild the physical location on the server

current directory: Server.MapPath(".")
parent directory: Server.MapPath("..")'
website root directory: Server.MapPath("/") is the same as Request.ServerVariables("APPL_PHYSICAL_PATH") except that the former does not include the trailing '/'

For that matter, none of the above MapPath expressions will return a trailing '/'
MapPath is useful when refererencing or writing out to a file, e.g.
xmldoc.save(Server.MapPath("sample.xml"))

Comments:

Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?