master
zpl 3 years ago
parent 9bc298c784
commit 1ea4efcdc2

@ -72,7 +72,7 @@ public class FileController {
//String newPath = new String(coderPath.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING); //String newPath = new String(coderPath.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING);
in = ftpClient.getFtp(path); in = ftpClient.getFtp(path);
if(null == in){ 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));
} }
//本地测试 //本地测试

@ -312,6 +312,7 @@ public class CappFtpClient {
*/ */
public InputStream getFtp(String path) throws Exception { public InputStream getFtp(String path) throws Exception {
login(); login();
ftp.enterLocalPassiveMode();
InputStream in = ftp.retrieveFileStream(path); InputStream in = ftp.retrieveFileStream(path);
return in; return in;
} }

Loading…
Cancel
Save