Home · Standard Web Hosting · Dedicated Web Hosting · Managed Name Servers · E-Mail Services
 
Home
/ Browse Categories / SmartWeb / Windows Services / Calling Files
Calling Files

We urge customers not to use absolute paths to files. Instead, there is the option of using the server.mappath method or including virtual paths.

Server.MapPath()

The MapPath method maps a relative or virtual path to a physical path. This method does not check for the validity or the existence of the physical path. If the path starts with a forward or backward slash, the method returns the path as if the path is a full virtual path. If the path does not start with a slash, then the method returns the path relative to the directory of the ASP file being processed.

The Path argument is the path to be mapped.

Code example:

<HTML>
<HEAD>
</HEAD>
<BODY>
The path of this file is <% Response.Write Server.MapPath("test.asp") %>
The path of the file1 is <% Response.Write Server.MapPath("\test.asp") %>
The path of the file2 is <% Response.Write Server.MapPath("test\test.asp") %>
The path of the file3 is <% Response.Write Server.MapPath("\") %>
</BODY>
</HTML>



User Comments
Calling Files
Add Comment
There are no user comments for this topic.
Add Comment
Additional Info
General Information
Article No. 73
Created: 01:38 AM 04.16.04
Author: Support

Attachments
No attachments.

Did this help you?
Yes No

Statistics
Yes504 (43%) Voted Yes684 (57%) Voted NoNo

Other Options
Print Article
Email Article

Related Articles
What COM Objects / Components do you support?
Create a DSN for an MS Access Database
Create a DSN for a MS SQL server
Create a DSN for a MySQL Database
Connecting to a database with a DSN

Copyright © 2013 myonlinehostingsupport.com