Apache Commons FTPClient 问题 - 425 无法建立数据连接:连接被拒绝 [英] Apache Commons FTPClient issue - 425 Can't build data connection: Connection refused

查看:46
本文介绍了Apache Commons FTPClient 问题 - 425 无法建立数据连接:连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Apache Commons FTP 库连接远程 ftp 服务器,我能够登录到 FTP 服务器,但之后我无法发出任何命令并在尝试检索文件时出现以下错误.

I am trying to connect a remote ftp server using Apache Commons FTP library, i am able to log into FTP server but after that i am not able to issue any command and getting following error when trying to retrieve file.

425 无法建立数据连接:连接被拒绝.但我在使用 MS-DOS 命令提示符登录时没有遇到任何问题.

425 Can't build data connection: Connection refused. but I am facing no issue while login using MS-DOS command prompt.

有人知道会是什么问题吗?

Do anybody know what would be the issue ?

谢谢.

推荐答案

没有看到代码这是在黑暗中刺伤,但你有没有尝试过以下

Without seeing code this is a stab in the dark, but have you tried the following

client.enterLocalPassiveMode();

如果您是从本地机器上传到远程 FTP 服务器.我记得我遇到了类似的问题,并且执行了上述操作

if you are uploading from a local machine to a remote FTP server. I remember I had a similar problem and doing the above worked

这篇关于Apache Commons FTPClient 问题 - 425 无法建立数据连接:连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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