4
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by mail2saion
0

The MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.

returns string

0

Thank you for your answer.

But I couldn't get the concept relative or vortual path.Could you please describe it for me.

Thanks in advance.

0

The MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.

0

It returns the physical path of the file or directory from the virtual path. As we setup a site in a remote server we don't have access to the server root path of our site in case of shared hosting. As our site is stored inside a particular folder of the server and by browser or by ftp access we can't move upward to wards the root of the server so it is not possible to get the physical path of any directory or file. Some of the objects like FileSystemObject requires physical path to handle various file and directory related commands. So here we can convert a virtual address of path to physical path by using Server MapPath method.

0

HI,
Why you do not try with below code:

Response.Write(Server.MapPath("any folder name within the root"));

Hope now you can understand.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.