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代码
最新推荐文章于 2024-07-18 13:41:54 发布