java ftp 使用被动模式

    xiaoxiao2021-12-14  20

    正常情况下,默认使用主动模式 连接ftp;如果ftp仍然是登陆成功但是没有上传或下载文件,就在登陆后加入一行代码,客户端使用被动方式连接ftp服务端      ftpC.login(user, password); //  ftpC.enterLocalPassiveMode();    if (null != remotePath) {    // 打开进入指定目录     ftpC.changeWorkingDirectory(remotePath);    }
    转载请注明原文地址: https://ju.6miu.com/read-964979.html

    最新回复(0)