I’m trying to programmatically copy a file from my web server to a UNC share on a fileserver. Both machines are Win2K and on the same Domain. I am using Integrated Windows Authentication throughout my site.
My web.config file is set up as follows:
<authentication mode="Windows" />
<identity impersonate="true" />
The code is pretty straight-forward…
Dim strFileName As String = “existingfile.pdf”
Dim strSavePath As String = “\\server\share\”
File.Copy(Server.MapPath(strFileName),strSavePath) <-- ERROR HERE
The error message is as follows:
Access to the path "\\server\share\” is denied.
My user account has domain admin rights but I assume this is more likely to be an ASPNET rights problem.
Does anyone have any code snippets or suggestions that might help?