System.IO.FileNotFoundException using file.copy

From: Stephen Witter (switter_at_enpathmed.com)
Date: 05/27/04

  • Next message: Joseph E Shook [MVP - ADSI]: "Re: Forms Authentication and classic ASP"
    Date: Thu, 27 May 2004 10:44:48 -0500
    
    

    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.


  • Next message: Joseph E Shook [MVP - ADSI]: "Re: Forms Authentication and classic ASP"

    Relevant Pages

    • Re: What doesnt lend itself to OO?
      ... >> proxy and instructs the server to constuct the real object. ... rather than client code. ... If 'clock' is instantiated in the server, ... > for the server interface at the OOA level. ...
      (comp.object)
    • This is going straight to the pool room
      ... or not the client has privilege to do what they're trying to do, ... The server environment is this: ... 3GL User action Routines that Tier3 will execute on your behalf during the ... Routine Name: USER_INIT ...
      (comp.os.vms)
    • [Full-Disclosure] R: Full-Disclosure Digest, Vol 3, Issue 42
      ... Full-Disclosure Digest, Vol 3, Issue 42 ... SD Server 4.0.70 Directory Traversal Bug ... Arkeia Network Backup Client Remote Access ...
      (Full-Disclosure)
    • Re: What doesnt lend itself to OO?
      ... > rather than client code. ... no way to do that without also touching the object with clock semantics ... will not encapsulate both clock semantics and network semantics. ... The server can do whatever it wants ...
      (comp.object)
    • RE: Fax monitor incoming + outgoing calls?
      ... problem between the client computer and the SBS server. ... Client is using the internal IP address of the SBS server as the ... To the folder redirection GPO issue: ...
      (microsoft.public.windows.server.sbs)