Let’s say that I have a site where once the user selects a few options, the following (should) happen:
- Grabs files (in a directory) off of the local machine – works fine so far
- Moves them to a remote server – this is where I need help
Details:
- The remote server will be found via UNC path (\servername\xyz)
- I have access to the username/password to access that UNC path, but since we are on a different domain and I don’t control IT’s decisions, I can’t have a single user that has permissions in both domains.
How do I go about setting up my site to do this? If I impersonate, then I might lose permissions to grab files on the local machine…
Note: I also have FTP access to the remote server. If there is a good FTP API that I could use, that would work as well, but I don’t want to have to iterate over each and every file.
Oh, this is .NET 1.1 as well.
This is a suggestion on a related question: Need to Impersonate user forAccessing Network resource, Asp.Net Account
I have done this cross domain before. All you need is for the username and password to be the same and this will work, even if they are in different domains. The thing to make sure of is that your .NET application is running as this user.
For instance: