From 57593aef0dcd4c884ae1bef2c238e2f3f05c246d Mon Sep 17 00:00:00 2001 From: tiansh Date: Tue, 30 Mar 2021 10:20:31 +0800 Subject: [PATCH] =?UTF-8?q?2021-03-30=E4=BF=AE=E5=A4=8DFTP=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/hellohao/service/impl/FTPImageupload.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/cn/hellohao/service/impl/FTPImageupload.java b/src/main/java/cn/hellohao/service/impl/FTPImageupload.java index c4d65cd..788589c 100644 --- a/src/main/java/cn/hellohao/service/impl/FTPImageupload.java +++ b/src/main/java/cn/hellohao/service/impl/FTPImageupload.java @@ -40,7 +40,7 @@ public class FTPImageupload { file = SetFiles.changeFile(entry.getValue()); String userkey =username + "/"+ uuid+times + "." + entry.getKey(); if (flag) { - ftps.upload(file, File.separator+userkey, ""); + ftps.upload(file, "/"+userkey, ""); ReturnImage returnImage = new ReturnImage(); returnImage.setImgname(userkey);//entry.getValue().getOriginalFilename() returnImage.setImgurl(key.getRequestAddress() + "/"+ userkey); @@ -52,7 +52,7 @@ public class FTPImageupload { ftps.close(); } - Print.Normal("要上传的文件路径:"+File.separator+userkey); + Print.Normal("要上传的文件路径:"+"/"+userkey); } }catch (Exception e){ e.printStackTrace(); @@ -71,7 +71,7 @@ public class FTPImageupload { String userkey =username + File.separator+ uuid+times + "." + entry.getKey(); ftps.mkDir(File.separator+username); if (flag) { - ftps.upload(file, File.separator+userkey, ""); + ftps.upload(file, "/"+userkey, ""); ReturnImage returnImage = new ReturnImage(); returnImage.setImgurl(key.getRequestAddress() + File.separator+ userkey); ImgUrl.put(returnImage, ImgUrlUtil.getFileSize2(new File(imgurl)));