FTPClient ftp = new FTPClient();
ftp.connect("ip");//连接FTP服务器
ftp.login("usrname", "password");//登录
int reply = ftp.getReplyCode();
ftp.changeWorkingDirectory(dirPath);
FileInputStream input = new FileInputStream(new File(filePath));
ftp.storeFile(fileName, input);
input.close();
ftp.logout();
FTP代码
最新推荐文章于 2023-11-23 10:49:00 发布