0

I'm currently building a web page that will serve customers with files relevant for products they bought from us. The web server is located on a remote web host, but the files I want to serve are located on a local FTP server.

Right now the client logs on to the web host and, depending on its credentials on the web page, receives a file listing from the corresponding account on our local FTP server. The client can download the files because I'm directing the link directly to the FTP server. However, I want to change that so that it is the web host that is serving the file, not the FTP server (but I obviously don't want to store the files on the web host).

So, upon request the web app should fetch a certain file from the FTP server (using SSL, I might add) and then forward it to the client via HTTP (not SSL).

Also, it would be freaking awesome if the client can start receiving the file immediately from buffer while it is being fetched from FTP :P

How can I do it?

4

1 回答 1

1

我不确定您要这样做的原因,因为它不必要地添加了许多中间层和工作,但是如果您仍然想在 .NET 中使用 FTP 请求客户端,请缓冲您想要服务的文件,然后简单地从您的 Web 应用程序打开响应流以直接通过您的 Web 应用程序提供此缓冲区。

这对您的 Web 服务器来说是很多不必要的工作,而不是简单地将这些文件保存在 Web 服务器本身的受保护文件夹中。

于 2011-01-31T16:02:01.053 回答