![]() |
|
|
Server.Mappath ExamplesBelow are examples on how to use Server.MapPath. Server.MappPath takes a path as a parameter and returns the exact physical location of that file on the hard drive. Read more on Server.MapPath. The following example uses the server variable PATH_INFO to map the physical path to a file. <%= Server.Mappath(Request.ServerVariables("PATH_INFO"))%> So if c:\inetpub\wwwroot is the web root folder and the code above
is in the file "server_mappath_examples.asp" in our codesnippets
directory then it might display c:\inetpub\wwwroot\codesnippets\server_mappath_examples.asp Please support our site by clicking on Google Ads
We can also use the Server.MapPath method to retrieve other file paths 'Our variable sCurrDir holds the current directory 'Our variable sParentDir holds the parent directory 'Our variable sRootDir holds the root directory If you have any code snippets to share with full credit given then send an email to Codesnippets - You'll receive full credit and a link back to your site. Site developed by Michael Wall - Web Design Belfast N.Ireland. |
|