| | |
| | | ftp.chdir(dirName); |
| | | flag = true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | //e.printStackTrace(); |
| | | flag = false; |
| | | } |
| | | return flag; |
| | |
| | | public static void main(String[] args) { |
| | | try { // 从ftp下载文件 |
| | | FtpHelper ftp = new FtpHelper("192.168.10.80", 21, "lxw", "lxw810412026"); |
| | | File file = new File("D:\\1.doc"); |
| | | ftp.uploadFile(file, "test/1.doc"); |
| | | File file = new File("D:\\IDEAWorkSpace\\CadDrawManager\\target\\face.zip"); |
| | | ftp.uploadFile(file, "test/face.zip"); |
| | | ftp.disconnect(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |