From 1ea4efcdc28597869f5644fc0d849fbcfc4db661 Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 16 Sep 2021 16:47:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=BA=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/foreverwin/mesnac/common/controller/FileController.java | 2 +- .../java/com/foreverwin/mesnac/common/ftp/CappFtpClient.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/FileController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/FileController.java index 03d1761e..67a1c89d 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/controller/FileController.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/FileController.java @@ -72,7 +72,7 @@ public class FileController { //String newPath = new String(coderPath.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING); in = ftpClient.getFtp(path); if(null == in){ - in = ftpClient.getFtp(new String(path.getBytes("UTF-8"), FTPClient.DEFAULT_CONTROL_ENCODING)); + in = ftpClient.getFtp(new String(path.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING)); } //本地测试 diff --git a/common/src/main/java/com/foreverwin/mesnac/common/ftp/CappFtpClient.java b/common/src/main/java/com/foreverwin/mesnac/common/ftp/CappFtpClient.java index 8fdef290..d192284a 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/ftp/CappFtpClient.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/ftp/CappFtpClient.java @@ -312,6 +312,7 @@ public class CappFtpClient { */ public InputStream getFtp(String path) throws Exception { login(); + ftp.enterLocalPassiveMode(); InputStream in = ftp.retrieveFileStream(path); return in; }