简体   繁体   English

通过代码将文件保存到备份服务器的最简单和/或最安全的方式?

[英]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.

相关问题 将对象保存到没有序列化属性的文件的最简单方法是什么? - What's the easiest way to save an object to a file without serialization attributes? 将对象的可观察对象集合保存到XML文件的最简单方法是什么? - What is the easiest way to save an Observable collectin of object to an XML file? 启动不受信任的URL的最安全方法是什么? - What's the safest way to launch an untrusted URL? 确定2个URL是否相同的最安全的方法是什么? - What's the safest way to determine if 2 URLs are the same? 解析具有许多不同级别的XML文件的最简单方法是什么? - What's the easiest way to Parse an XML file with many different levels? 在c#中加密文件最简单的方法是什么? - What's the easiest way to encrypt a file in c#? 如何通过C#代码创建Outlook兼容格式的SQL服务器数据备份文件 - How to create SQL Server data backup file in Outlook Compatible format by C# code 中止第三方库代码中执行的最安全方法 - The safest way to abort an execution in a third-party library code 从Action <T>的实例获取Invoke MethodInfo的最安全方法 - Safest way to get the Invoke MethodInfo from Action<T>'s Instance 在visual studio 2013中进行备份的最简单方法是什么? - What is the easiest way to make a backup in visual studio 2013?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM