简体   繁体   English

如何为存储在 FTP 空间中的文件提供服务

[英]How to serve files stored in FTP space

My ASP.Net MVC application allows you to download files that are stored in a repository accessible via FTP.我的 ASP.Net MVC 应用程序允许您下载存储在可通过 FTP 访问的存储库中的文件。

I would need to implement the best strategy to serve these files to the client.我需要实施最佳策略来将这些文件提供给客户端。 I could implement a method that downloads the file from FTP and then serves the file through FileResult ... but clearly it does not seem the best way at all (especially in the case of large files the client should first wait for the application to download the file and then wait a second time for the time necessary for the download).我可以实现一种方法,从 FTP 下载文件,然后通过 FileResult 提供文件......但显然它似乎根本不是最好的方法(特别是在大文件的情况下,客户端应该首先等待应用程序下载文件,然后第二次等待下载所需的时间)。

Any indication or help will be appreciated任何指示或帮助将不胜感激

If the web server can only access the files over FTP, then that's the way to go.如果 web 服务器只能通过 FTP 访问文件,那么这就是要走的路。

If the files are on a different server, your web server needs to download them from there (either entirely or streaming) before it can serve them to its HTTP clients.如果文件在不同的服务器上,您的 Web 服务器需要从那里下载它们(完全或流式),然后才能将它们提供给 HTTP 客户端。

Alternatively both servers could share the same file location, either by attaching the same (virtual) disk or through another network protocol such as NFDlS, SMB, ...或者,两个服务器可以通过附加相同的(虚拟)磁盘或通过其他网络协议(如 NFDlS、SMB 等)共享相同的文件位置。

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

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