开发者

From FTP to web server to web client

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 fil开发者_StackOverflow中文版es 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?


I am not sure of the reasons you want to do this since it unnecessarily adds a lot of intermediate layers and work, but if you still want to then use the FTP request client in .NET, buffer the file you want to serve and then simply open the response stream from your web application to serve this buffer directly via your web application.

It is a lot of unnecessary work for your web server instead of simply saving these files in a protected folder on the web server itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜