简体   繁体   English

在Web场的Web服务器上的文件夹位置上写

[英]Write on a folder location on the web servers of a web farm

I have a web application hosted on a web farm. 我在Web场上托管了一个Web应用程序。 In the application there is a functionality where by user can write the files on a folder located on the virtual directory in the IIS like this: 在应用程序中,有一种功能,用户可以通过该功能将文件写入IIS中虚拟目录下的文件夹中,如下所示:

var compressedFile = FileCompression.GetCompressedAndEncrypted(xml);
File.WriteAllBytes((filePath), compressedFile);

The issue here is that only the server that hooked to the client gets the updated files, but the requirement is to do this on both the servers of the farm simultaneously . 这里的问题是,只有挂接到客户端的服务器才能获取更新的文件,但要求同时在服务器场的两台服务器上执行此操作 There are two servers in the farm. 服务器场中有两个服务器。

I want to achieve this programmatically. 我想以编程方式实现这一目标。 Please suggest... 请建议...

You can do one of the following - 您可以执行以下任一操作-

  1. store in database (easy to implement, but only good for small files) 存储在数据库中(易于实现,但仅适用于小文件)
  2. store in common location where all servers can access (like Windows Azure's Blob storage) 存储在所有服务器都可以访问的公共位置(例如Windows Azure的Blob存储)
  3. use Microsoft Sync Framework to sync files (steep learning curve) 使用Microsoft Sync Framework同步文件(深度学习曲线)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM