In C #, how can I access a file archive in a domain from outside the domain?

I have a web server where people upload files. I need to make these files and write them to a file share in an Active Directory domain. Problem - the web server is not in the domain.

So how is the best way to do this? I would have thought it would be easy, something like creating a connection with some credentials and doing it. But apparently not. The closest I found is an impersonation WindowsIdentity.Impersonate, but all I read says this is a bad idea in a production environment.

Any ideas? I am working on a solution that supports FTP files, but this is unsatisfactory and has a backup plan.

I am using C # and .net 4.0 in a (obviously) Windows environment.

Change: . I must indicate that I cannot start servers (or services) that access the outside of this domain. FTP connection is a temporary solution.

+3
source share
3 answers

I would have another program, maybe the Windows service selects files from the location of the web service file and transfers them to the directory of the active directory. I would probably perform this process from where they are copied. Make them available in the shared folder on the web server, visible only to the process user and administrators.

+1
source

, FTP , Windows Share; , - - . , WindowsIdentity.Impersonate - ? , ?

0

Is there any way to map this file as a network driver. If you can do this, you do not need to manage security and it will be very easy to access these files as if they were local.

0
source

Source: https://habr.com/ru/post/1780046/


All Articles