S
Stephen Witter
I am trying to copy a file to a network drive. I can do it on the
domain controller/web server but not from a client. Here is the code:
Dim impersonationContext As
System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
currentWindowsIdentity =
CType(User.Identity,System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()
dim Temp as string="TestFile"
File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")
impersonationContext.Undo()
I get the error "System.IO.FileNotFoundException: Could not find file
\\Server\File..." when running it from the [authenticated] client
browser. I searched everywhere on the web and MSDN on this error but found
nothing. The error it occurs on the file copy statement The file.copy
statement is trying to copy a file on a different server than the web
server.
Any help is appreciated.
domain controller/web server but not from a client. Here is the code:
Dim impersonationContext As
System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
currentWindowsIdentity =
CType(User.Identity,System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()
dim Temp as string="TestFile"
File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")
impersonationContext.Undo()
I get the error "System.IO.FileNotFoundException: Could not find file
\\Server\File..." when running it from the [authenticated] client
browser. I searched everywhere on the web and MSDN on this error but found
nothing. The error it occurs on the file copy statement The file.copy
statement is trying to copy a file on a different server than the web
server.
Any help is appreciated.