Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server.MapPath

Status
Not open for further replies.

robertfah

Programmer
Joined
Mar 20, 2006
Messages
380
Location
US
I have a website that resides on 1 drive and data on another. I've created a virtual drive in IIS for the data drive and called it 'd_drive'.

In classic asp, I used to be able to write this:

Code:
Server.MapPath("\asc\customers\common\Self Extracting Files\text.txt)

and that would point to that drive, but when I do it in asp.net (C#) it doesn't seem to work.

Code:
string sServerMapPath = Server.MapPath(@"\asc\customers\newsite\common\MaxSim Tower\Self Extracting Files\");

 
try using Server.MapPath("../<foldername>/")
 
one of these 2 methods will work
Code:
Server.MapPath(@"\\[server]\[drive letter]\...\[file name]");
or
Server.MapPath(@"[drive letter]:\...\[file name]");

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top