Thanks for the reply Michael...
Is there no way to just have each box trust the other or give the
appropriate rights to each dll assembly?
It seems odd with .NET, that to copy a file between web servers I have to
have 40 or so lines of impersonation code.
Thanks,
Chris
"Raterus" <> wrote in message
news:...
File.Copy("\\Server1\share\file.abc", "\\Server2\share\file.abc", true)
But before you can do this, you are going to have to impersonate a valid
domain user that can perform this operation. This can be done via
web.config using
<identity impersonate="true" userName="DOMAIN\bob" password="mypassword" />
But if you don't want your entire application running as this user (I
woudln't), you can impersonate via code with examples from this article (you
would need to use second way if you have a specific user that you want to
use), or the first article if you are using credentials from the
authenticated client.
http://support.microsoft.com/default...b;en-us;306158
Hope this helps,
--Michael
"Chris Strobel" <> wrote in message
news:%...
> I have 2 web servers where I need to write a PDF file and need to keep
them
> in sync. In others words, If the Server1 is getting called to create the
> PDF, then it needs to copy the PDF to the other Server2 and visa-versa.
The
> 2 server are running 2003.
>
> It's a form-based authentication (.NET 1.1) site and I'm using IIS 6
native
> mode. Both boxes are set to the same workgroup. Since everything is so
> locked down now, I'm not sure what's the best way to copy files to another
> server from within a VB ASPX page. I've seen some sample impersonation
code
> but it seems like there would be an easier way.
>
> Thanks,
> Chris
>
>