Re: File.Copy



On 2007-11-24 00:18:12 -0800, rgw1@xxxxxxxxxxx said:

Hello,

Can anyone help with this?

I am using C# with IIS 6.0 on Windows 2003 Server. I am trying to copy
a file over the network. It is attempting to copy a file on a NAS
(external hard drive), which is Linux based. I have already set the
permission on the NAS and I can copy files manually without any
problem. If I run the same code on IIS 5.1 on Windows XP on the same
network, it works!

When you are testing it on the other system, are you using the same exact user ID and password?

The exception looks like a straight permissions problem. Windows file security can be kind of quirky, so it's hard to say exactly without more information what a precise solution to a permissions problem would be (depending on the configuration of the network, you might need to have an exact NT domain account, or just log in with the right username and password, or provide the necessary credentials via "net use", or...).

But as a general rule, if you've got a system from which you can access the file, and one from which you can't, it's possible that you're just using different credentials on each system. Use the same working set of credentials on both, and it should work.

Of course, this means it doesn't really have anything to do with the C# code per se. But close enough. :)

Pete

.



Relevant Pages

  • Re: Network isolation: local logins ?
    ... Regarding the local user accounts, in Windows XP and Windows 2003, if the ... secured/isolation network using its configured IPsec-based authentication ... The credentials of the user are not evaluated when determining ... IP extends the core IKE functionality of machine authentication to also ...
    (microsoft.public.windows.server.networking)
  • File.Copy
    ... a file over the network. ... If I run the same code on IIS 5.1 on Windows XP on the same ... String destFileName, Boolean overwrite) System.IO.File.Copy(String ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Directory.CreateDirectory - Could not find a part of the path
    ... > identity of the iis request thread. ... > if iis is setup with windows authenication, ... > access any network resource. ... >> impersonate to true and turning off anonymous login and using integrated ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Using Windows Account name
    ... >>I have a standalone webserver running IIS in a netware network. ... >>webserver do not have an windows account on the webserver. ...
    (microsoft.public.inetserver.iis)
  • Re: HTTP 400 - Bad Request
    ... Windows Server 2003 comes with Network Monitor, ... none of those settings have ANYTHING to do with a 400 Bad Request. ... and IIS never bothered to execute it. ...
    (microsoft.public.inetserver.iis)