How to copy a file on to shared folder.
Hi.. Please help me out.. Am unable to copy a file to a shared folder(eg:\\192.168.3.12\Downloads\) using a windows service. I tried with File.Copy(), FilewebRequest and WebClient also. In all the scenario's am getting 'Access to the path is denied'. I gave all the permissions to the folder. But still same exception persists.
Madhu SudanPosted Apr 30, 2008, 5:16 AM
Actually i didnt get what u said.. I created virtual directory for that folder with all permissions and then i tried to access that..Same exception persists.. One thing i didnt understand, u told me to use the same account the windows service runs in and have the service connect to that virtual directory. can u just ellaborate on this..
I tried the following
File.Copy(@"D:\e-Books\SQL_Questions.pdf",@"\\192.168.3.23\Downloads\",true);
and the exception is
File.Copy(@"D:\e-Books\SQL_Questions.pdf",@"\\192.168.3.23\Downloads",true)' threw an exception of type 'System.UnauthorizedAccessException'
base {System.SystemException}: {"Access to the path '\\\\192.168.3.23\\Downloads' is denied."}
-----
Note: 192.168.3.23 is on a different machine with different username and password
Scott LyslePosted Apr 30, 2008, 4:21 AM