What is the absolute or direct path for my Windows (ASP) hosting account?
Your account's Hosting Control Panel displays your absolute path. For more information, see Finding Your Hosting Account's Absolute Path.
You can also use ASP/ASP.NET to find your absolute path. Within ASP/ASP.NET, the function Server.MapPath
returns the full path to your hosting account. If you create a directory called "subdir," you could return the path to "'subdir" using Server.MapPath("subdir")
.
NOTE: Keep in mind that with ASP hosting, by default an ASP/ASP.NET script does not have write access to the root directory or subdirectories of a hosting account. If you want to specify write access to the root directory or a subdirectory, you must define write access to that directory through the FTP File Manager option in your hosting account settings. You can also use the IIS Settings to set up a "Virtual Root" in IIS by selecting the Set Application Root option.
The following ASP server path example returns the current directory:
Dim currentdirectorypath
currentdirectorypath = Server.MapPath(".")
response.write currentdirectorypath
%>
The data returned depends on the parameter you pass to the function and your directory structure. The following examples return the parent directory path, the application's root directory, and the path to a specific page:
- Server.MapPath("..")
- Server.MapPath("/")
- Server.MapPath("myPage.aspx")