FtpClient.storeFile返回false解决方法

参考:http://www.cnblogs.com/xiangpiaopiao2011/archive/2012/02/28/2371679.html

返回错误:ftp connect time out.

先判断是否登录成功,若登录成功之后FtpClient.storeFile还返回false,则参考下面代码

ftpClient.enterLocalPassiveMode();
ftpClient.setControlEncoding("UTF-8");
boolean stored = ftpClient.storeFile(new String(fileName.getBytes("UTF-8"),"iso-8859-1"), inputStream);
posted on 2016-12-26 20:31  qinyahui  阅读(3026)  评论(0编辑  收藏  举报