FtpUtil.java测试 (淘淘商城第三课文件上传)

 

首先在common-taotao中创建一个utils包,复制FtpUtil.java到其中。然后如下:

 

 @Test

     public void testFtpUtil() throws Exception{

        FileInputStream inputStream = new FileInputStream(new File("D://Document

\\pictures\\images\\201122.jpg"));

  FtpUtil.upLoadFile("192.168.25.133","21","ftpuser","ftpuser","/home/ftpuser/www/images"

,"2517/05/13","hello.jpg","inputStream ");

}

posted on 2017-05-13 22:28  尴尬而不失礼貌的微笑  阅读(645)  评论(0编辑  收藏  举报