ASP Server.MapPath() - Application Object Returns the physical file path that corresponds to the specified virtual path on the Web server.
ShotDev Focus:
- The physical file path that corresponds to path.
Example
asp_server_mappath.asp
<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim FSO,objFile
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
'*** thaicreate.txt Path C:\Inetpub\wwwroot\myasp\MyFiles\shotdev.txt ***'
Set objFile = FSO.OpenTextFile(Server.MapPath("shotdev.txt"), 1)
Response.Write(objFile.ReadAll)
objFile.Close
Set objFile=Nothing
Set FSO=Nothing
%>
</body>
</html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_server_mappath.asp
Screenshot


