java ftp 使用被动模式

正常情况下,默认使用主动模式 连接ftp;如果ftp仍然是登陆成功但是没有上传或下载文件,就在登陆后加入一行代码,客户端使用被动方式连接ftp服务端

     ftpC.login(user, password);
//  ftpC.enterLocalPassiveMode();
   if (null != remotePath) {
   // 打开进入指定目录
    ftpC.changeWorkingDirectory(remotePath);
   }

你可能感兴趣的:(java)