[英]How do I save files to a server different from the server where my ASP.NET API application is on
So I am building a document management system where files are stored, retrieved and managed using ASP.Net Web API.因此,我正在构建一个文档管理系统,使用 ASP.Net Web API 在其中存储、检索和管理文件。 I have achieved saving the files to the application server (that is the same server where the API is hosted) this can be on IIS, Azure App Service or any other hosting provider.
我已经将文件保存到应用程序服务器(即托管 API 的同一台服务器),这可以在 IIS、Azure 应用服务或任何其他托管服务提供商上。
My challenge now is I wish to have a file server, that is a different server where only files will be stored while the API remains on another server.我现在面临的挑战是我希望拥有一个文件服务器,这是一个不同的服务器,其中仅存储文件,而 API 保留在另一台服务器上。 For instance, let's say my API is running on IIS on Server A (1.1.1.1), I don't want to store the files being uploaded to Server A, I have another Server B(1.1.1.2), which I can also configure IIS on, however, all I want to do with it is store the files sent to the API.
例如,假设我的 API 在服务器 A (1.1.1.1) 上的 IIS 上运行,我不想存储上传到服务器 A 的文件,我有另一个服务器 B(1.1.1.2),我也可以配置 IIS,但是,我想要做的只是存储发送到 API 的文件。
NB.注意。 Both servers are windows servers.
两台服务器都是windows服务器。
My most challenging questions now are:我现在最具挑战性的问题是:
Yes it's is doable.I had a similar challenge.是的,这是可行的。我遇到了类似的挑战。 I am a Node Js guy but I believe this will work for you as well.
我是一个 Node Js 人,但我相信这也适用于你。
You can achieve that by the use of Queuing with Redis or any other memory database.您可以通过使用 Redis 或任何其他内存数据库的队列来实现这一点。
Here when you send a file to server A, Instead of saving it, You simply send it to server B through the corresponding publisher and server B will receive the task through the corresponding subscriber.这里当你将文件发送到服务器 A 时,不是保存它,而是通过相应的发布者将其发送到服务器 B,服务器 B 将通过相应的订阅者接收任务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.