Welcome to Bucaro TecHelp!

Bucaro TecHelp
HTTPS Encryption not required because no account numbers or
personal information is ever requested or accepted by this site

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

ASP Server Object

The Server object provides access to properties and methods on the server. The Server object MapPath method maps a website path to a physical server path.

The example below uses the server variable PATH_INFO to map the physical path of the current file.

Server.MapPath(Request.ServerVariables("PATH_INFO"))

If C:\Inetpub\Wwwroot is the server's home directory, the above statement will return:

C:\inetpub\wwwroot\script\test.asp

The example below starts the path parameter with a slash character to specify that the path returned should be as complete virtual paths on the server.

Server.MapPath("/script/test.asp")

If C:\Inetpub\Wwwroot is the server's home directory, the above statement will return:

C:\inetpub\wwwroot\script\data.txt

Because the path parameter in the following example does not start with a slash character, it is mapped relative to the directory that contains the file.

Server.MapPath("data.txt")

In IIS 6 or higher, for security reasons, the AspEnableParentPaths property has a default value set to FALSE. Scripts will not have access to the physical directory structure unless AspEnableParentPaths is set to TRUE.

PropertyDescription
ScriptTimeoutScriptTimeout sets the maximum amount of time (in seconds) that the script on the page can run before it is terminated. The default value is 90 seconds.

 

MethodDescription
CreateObjectCreateObject creates an instance of the object (component, application or a scripting object) and returns a reference to it. Once created, the object's properties and methods can be used. 
Execute Execute runs another .asp page without leaving the current page. It stops execution of the current page and transfers control to the specified page. When that page has completes execution, control passes back to the calling page.
GetLastErrorGetLastErrorreturns an ASPError object that describes the error condition that occurred.
HTMLEncodeHTMLEncode applies HTML encoding to a specified string. All not valid characters are converted to their equivalent HTML entity.
MapPath MapPath maps a specified virtual or relative path to a physical path on the server.
TransferTransferstops execution of the current page and sends all current state information to another specified page. When that page has completes execution, control does not resume with the calling page.
URLEncodeURLEncode applies URL encodingto a specified string. All characters that are not valid in a URL string are converted to their equivalent HTML entity.

RSS Feed RSS Feed

Follow Stephen Bucaro Follow @Stephen Bucaro

Fire HD
[Site User Agreement]  [Advertise on This site]  [Search This Site]  [Contact Form]
Copyright©2001-2010 Bucaro TecHelp P.O.Box 18952 Fountain Hills, AZ 85269