Is there a way to tell if the FTP server is active or passive in the Java web program?

烂漫一生 提交于 2019-11-29 12:35:40

As @Erwin already commented, servers are not in active or passive mode. Servers usually support both modes at the same time.

A mode that you need to use, typically depends on a configuration of the network between you and the server, not on some "switch" on the server. There's hardly any way to detect that.

All you can do is to try one mode and fallback to the other if the first mode fails. In general, you should start with the passive mode, as that tends to work more often.

Read also my article on FTP connection modes and the network configuration needed for them, to understand, what this is about.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!