- InputStream inputStream = ftpClient.retrieveFileStream 总是返回null。downloadFile 报IOException,stream closed
//修改前
ftpClient.retrieveFileStream(remoteFileName);
//设置一下字符集即可
ftpClient.retrieveFileStream(new String(remoteFileName.getBytes(“GBK”), “ISO-8859-1”));
- retrieveFileStream第二次读取返回null
解决方法:在执行完inputStream.close();方法之后,执行ftpClient.completePendingCommand();
3.ftpClient.deleteFile删除文件名包含中文的文件失败
解决方法:ftpClient.deleteFile(new String(fileName.getBytes(“GBK”), “ISO-8859-1”))
4.FAIL MKDIR: Client
绝对路径换成相对路径 /resource —> resource/
参考资料:
https://blog.youkuaiyun.com/weixin_39654286/article/details/94733313
https://www.cnblogs.com/karlz/p/14075233.html
https://blog.youkuaiyun.com/zpf89/article/details/88809449
https://stackoverflow.com/questions/39203975/filesystem-mkdir-failed-to-create-client-symfony