Link to home
Start Free TrialLog in
Avatar of fleet
fleet

asked on

Create text file on different server.

I have a web page that once selected will create a text file.  I need this file to be created on a different server so the users can have access to it.
I'm using:
 
 fp = File.CreateText(Server.MapPath("\\ServerName\TRANSMITTALS") & "\" & TxtFileName)

I keep getting the following error message:

File Creation failed. Reason is as follows System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\inetpub\wwwroot\ServerName\TRANSMITTALS\Monthly_AutoRentals_72005.txt'.

'c:\inetpub\wwwroot\ is not on the server I'm trying to create the Monthly_AutoRentals_72005.txt file on.

Can someone tell me what I'm doing wrong?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Shalom Carmel
Shalom Carmel
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fleet
fleet

ASKER

I tried it and it worked.  Thank you for you help.