Re: Impersonation when performing IO operation using File.Copy

From: Bunty (Bunty_at_discussions.microsoft.com)
Date: 12/13/04

  • Next message: Andy: "RE: 2 domain names, 1 IP, one SSL cert"
    Date: Mon, 13 Dec 2004 12:45:08 -0800
    
    

    Hi Daniel,

    Thanks for your reply,

    Yes, user does have permission to the specified folder. I am impersonating
    domain user which has all the permissions on the folder.

    And the error I am getting is not at all is related to the permissions. It
    does not find the file at all. And file does exist in that folder but it
    still raises "Could not find file'' " error.

    Thanks,
    Bhupendra

    "Daniel Fisher(lennybacon)" wrote:

    > Hi Bhupendra
    >
    > Does the impersonated identity hav permissions on
    > "\\remotecomputer\C$\Asset\1_4.wmv" ?
    > Cause of "C$" is the identity admin?
    >
    > --
    > Daniel Fisher(lennybacon)
    > MCP ASP.NET C#
    > Blog: http://www.lennybacon.com/
    >
    >
    > "Bunty" <Bunty@discussions.microsoft.com> wrote in message
    > news:DA572378-FF33-469E-A484-DEF5B56D49A9@microsoft.com...
    > > Hello,
    > > I am trying to implement impersonation for the copying file from one
    > > remote
    > > directory to the other remote drive on the same server in ASP.Net page.
    > >
    > > Impersonation seems to be working fine. It seems to perform the
    > > impersonation but when it tries to copy the file then it raises the
    > > exception
    > > 'Could not find the specified "...."'.
    > >
    > > I am sure that the file exists in that folder but still it is raising the
    > > same error everytime.
    > >
    > > Here is detail of the complete error
    > >
    > > Server Error in '/' Application.
    > > --------------------------------------------------------------------------------
    > >
    > > Could not find file "\\remotecomputer\C$\Asset\1_4.wmv".
    > > Description: An unhandled exception occurred during the execution of the
    > > current web request. Please review the stack trace for more information
    > > about
    > > the error and where it originated in the code.
    > >
    > > Exception Details: System.IO.FileNotFoundException: Could not find file
    > > "\\remotecomputer\C$\Asset\1_4.wmv".
    > >
    > > Source Error:
    > >
    > > An unhandled exception was generated during the execution of the current
    > > web
    > > request. Information regarding the origin and location of the exception
    > > can
    > > be identified using the exception stack trace below.
    > >
    > > Stack Trace:
    > >
    > >
    > > [FileNotFoundException: Could not find file
    > > "\\remotecomputer\C$\Asset\1_4.wmv".]
    > > System.IO.__Error.WinIOError(Int32 errorCode, String str) +181
    > > System.IO.File.InternalCopy(String sourceFileName, String destFileName,
    > > Boolean overwrite) +314
    > > System.IO.File.Copy(String sourceFileName, String destFileName) +7
    > > SampleDailies.createclip.CreateFile() in
    > > C:\Web\Technicolor\SampleDailies\MediaAdministration\createclip.aspx.vb:159
    > > SampleDailies.createclip.Page_Load(Object sender, EventArgs e) in
    > > C:\Web\Technicolor\SampleDailies\MediaAdministration\createclip.aspx.vb:28
    > > System.Web.UI.Control.OnLoad(EventArgs e) +67
    > > System.Web.UI.Control.LoadRecursive() +35
    > > System.Web.UI.Page.ProcessRequestMain() +750
    > >
    > >
    > > Thanks,
    > > Bhupendra
    > >
    > >
    > > --------------------------------------------------------------------------------
    > > Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
    > > ASP.NET
    > > Version:1.1.4322.2032
    > >
    >
    >
    >


  • Next message: Andy: "RE: 2 domain names, 1 IP, one SSL cert"

    Relevant Pages

    • RE: Error when attaching multiple files (System.web.mail)
      ... Settings folder on your machine to the authenticated domain user account. ... Try to give permissions to ASPNET user account on the local folder where ... you are storing your attachments. ... > following exception. ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: OWA on Exchange 2007 not working
      ... permissions should be inherited from the parent Exchange Server folder). ... Exception type: HttpException ... Thread account name: NT AUTHORITY\SYSTEM ...
      (microsoft.public.exchange.clients)
    • Re: simple web fails with C:Temp problem
      ... Have your web guy send a screenshot of the permission setting where ASPNET ... user has access to that folder. ... Go ahead and try impersonation to see if that works. ... guy probably didn't set the permissions to the ASPNET user. ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: No rights to report server bin folder
      ... permissions to that folder, whenever I try I can only obtain the ... Domain\aspnet account. ... different weays but I just always can give the domain/ASPNET permissions to ... exception can be identified using the exception stack trace below. ...
      (microsoft.public.inetserver.iis.security)
    • Re: Impersonation in ASP.net
      ... I am impersonating using a domain user which has all the permissions on the ... > security context to do something to a file on a remote drive. ... >> impersonation in ASP.Net process either? ... Information regarding the origin and location of the exception ...
      (microsoft.public.dotnet.framework.aspnet.security)

    Loading