Hello everyone,
I have a server A that has many documents stored. I want to copy documents from server A to my webserver.
What is the best way to do this ? I am doing something like this, but it doesnt seem to work:
string Source = Server.MapPath(@"\syspdf\positions\testdoc.pdf");
string Destination = @"C:\Inetpub\wwwroot\PORT\attachments";
File.Copy(Source, Destination, true);
Here, server A has been mapped on my IIS as syspdf. I am able to access this path by opening in my browser. However, i am unable to access files from this location through my code. I use something like this:
File[0] = Server.MapPath(@"\syspdf\positions\testdoc.pdf");
I get an error when i execute it : \\nyc6034\positions\testdoc.pdf not found as file or resource.
As you must have guessed it, nyc6034 is the name of the server which has been mapped as syspdf on my IIS.
...
Go to the complete details ...