[英]easiest and/or safest way(s) to save a file to a backup server by code and how?
Full edit: 完整编辑:
The scenario is that after uploading the file to the server via a secured web service, I'd like to save/create a copy of that file to another server in a LAN or another network. 场景是,通过安全的Web服务将文件上传到服务器后,我想将该文件的副本保存/创建到LAN或另一个网络中的其他服务器。
I'd like to know what possible ways I could use to programmatically copy/create the backup of the file uploaded to the backup server (saving the file to the database would be the last option probably). 我想知道我可以通过什么方式以编程方式复制/创建上传到备份服务器的文件的备份(将文件保存到数据库可能是最后的选择)。
Here are a few details: 以下是一些详细信息:
Files are of different types and sizes mostly text, documents and images that would be around a few KB to a couple of MB's. 文件的类型和大小不同,主要是文本,文档和图像,大小约为几KB到几MB。
Database is SQL Server 2008 R2 and the only way to connect to it is via calls to a secured WCF service. 数据库是SQL Server 2008 R2,连接数据库的唯一方法是通过调用安全的WCF服务。
Servers can be in the same LAN or on separate networks (depends on the client requesting). 服务器可以位于同一LAN或不同的网络中(取决于客户端的请求)。
The 2nd server is a redundant server and is using the 1st one as it's backup and vice versa. 第二台服务器是冗余服务器,正在使用第一台作为备份服务器,反之亦然。
Took me a while to find this post. 花了我一段时间找到这篇文章。 Just map the drive to the backup server's shared folder and implement WindowsImpersonationContext. 只需将驱动器映射到备份服务器的共享文件夹并实现WindowsImpersonationContext。
How to Impersonate a user in managed code? 如何在托管代码中模拟用户?
haven't seen security problems on this and doesn't need to mess with the HTTP/certificates. 尚未看到有关此问题的安全性问题,也不需要弄乱HTTP /证书。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.