dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Web
Expertise: Intermediate
Nov 22, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Finding Your Directory in IIS for the FileSystemObject

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 %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
Response.Write Request.ServerVariables("PATH_INFO") & "<BR>" 
Response.Write Request.ServerVariables("SCRIPT_NAME") & "<BR>"
Response.Write Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))
%>
<HR>
<%
for each Var in Request.ServerVariables
 Response.Write Var & ":" & Request(Var) & "<BR>"
next
%>
</BODY>
</HTML>
Ken Cox
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date