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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual directory ?

Status
Not open for further replies.

headguru

Programmer
Oct 7, 2002
4
US
HI,
I have this code:

strFile = Session("Username") & "_" & AppName ' & "_" & mydate
csvFile = "\tool\csv\" & strFile & ".csv"
strFile = server.mappath("\") & "\tool\csv\" & strFile & ".csv"
set a = fs.Createtextfile(strFile, true)

It creates a CSV file in the csv directory. But I had to move the whole "tool" directory to a different drive so now have a virtual "tool" directory setup in IIS.

When this code is run using the virtual directory it returns path not found (since its no longer in c:\inetpub\ but on E:\somewhere)

What can I do to to create the CSV in the folder on the new drive?

Thanks
 
Someone correct me if I'm wrong but I think you will have to be explicit:

filepath = "e:\somewhere" & "\tool\csv\" & strFile & ".csv"


Just be sure to set it ("e:\somewhere") up as a constant declared somewhere so if the path changes again you know where to change it and you only have to do it once.

HTH
 
Yes... The application won't know of the virtual folder because the virtual folder is a new and different application. A server.mappath won't work. You will have to do the real location (C:\csv\somefile.csv).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top