Jan 5, 2011 at 9:05 AM

I am trying to copy file from temp sandbox folder to network path

variable UploaderControlSandboxMoveToPath is set to "\\pcname\test"
Ibut it is giving me error as Login failed for NT AUTHORITY\NETWORK SERVICE.
I have implemented Impersonation in web.config. but still this method is giving error. not copying file to other pc using impersonation. On same machine it works
any Idea?

void ProcessFile(HttpContext Context, string FileGuid, string FileName, string ContextParam) { try { string sandboxPath = Path.Combine(Sandbox.UploaderControlSandboxPath, FileGuid); string fileExtention = Path.GetExtension(FileName); string Orgfilename = Path.GetFileNameWithoutExtension(FileName); FileInfo fi = new FileInfo(sandboxPath); string filepath = Path.Combine(Sandbox.UploaderControlSandboxMoveToPath, FileName); fi.CopyTo(filepath, true); using (FileStream fs = File.OpenRead(sandboxPath)) { // do something useful to the file } // for testing, this example just deletes the file from the sandbox after it has been uploaded; comment // out this line if you want to verify that files are being uploaded correctly while testing File.Delete(sandboxPath); } catch (Exception ex) { } }