The FileSystemObject object (sic) in Active Server Pages (ASP) is very handy for reading, writing, and deleting files via server-side script. However, it isn’t always easy to locate your files on your ISP’s system. The FileSystemObject object requires a physical path to the file, not a virtual directory name. Fortunately, you can calculate the exact path using ASP’s Request.ServerVariables and Server.MapMath methods. Once you determine where your virtual directory resides, you can pass the path to the FileSystemObject object’s methods.
This script shows how to use Request.ServerVariables to discover the needed information–and a lot more–from Internet Information Server (IIS).
<%@ Language=VBScript %><%Response.Write Request.ServerVariables("PATH_INFO") & "
" Response.Write Request.ServerVariables("SCRIPT_NAME") & "
"Response.Write Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))%>
<%for each Var in Request.ServerVariables Response.Write Var & ":" & Request(Var) & "
"next%>