FTP文件上传与HTTP代理 [英] FTP File Upload with HTTP Proxy

查看:282
本文介绍了FTP文件上传与HTTP代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有将文件上传到FTP服务器的方式,当后面的HTTP代理?

Is there a way to upload a file to a FTP server when behind an HTTP proxy ?

看来,上传文件没有使用的.Net Web客户端的HTTP代理服务器背后的支持。 (<一href=\"http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.proxy.aspx\">http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.proxy.aspx).

It seems that uploading a file is not supported behind an HTTP Proxy using .Net Webclient. (http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.proxy.aspx).

如果没有解决方法?如果没有,你知道一款优秀且免费的FTP库可以使用吗?

If there is no workaround ? If not, do you know a good and free FTP library I can use ?

修改:不幸的是,我没有任何FTP代理连接到

Edit: Unfortunately, I don't have any FTP proxy to connect to.

推荐答案

在主动FTP模式下,服务器启动到客户端的数据连接。如果客户是后面的HTTP代理服务器,这显然是行不通的。在被动FTP模式是谁发起了初始和数据连接的客户端。由于HTTP代理可以隧道任意传出TCP连接(使用CONNECT方法),应该可以通过HTTP代理访问被动模式的FTP服务器。

In active FTP mode, the server initiates a data connection to the client. If the client is behind an HTTP proxy, this obviously won't work. In passive FTP mode it is the client who initiates both the initial and the data connections. Since HTTP proxies can tunnel arbitrary outgoing TCP connections (using the CONNECT method), it should be possible to access an FTP server in passive mode via an HTTP proxy.

的FtpWebRequest 似乎支持被动模式。不过,我不明白为什么文件下载和目录列表的支持,而文件上传,也使用相同的数据连接,是不是。

The FtpWebRequest seems to support passive mode. However, I don't understand why file download and directory listings are supported, whereas file upload, which also uses the same data connection, is not.

你有没有证实,的FtpWebRequest 配置为被动模式下通过HTTP代理不起作用通过目录列表/文件下载工作就好了?

Have you confirmed that FtpWebRequest configured for passive mode does not work via an HTTP proxy through which directory listings/file download work just fine?

这篇关于FTP文件上传与HTTP代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆