| @@ -176,9 +176,8 @@ public class UploadController extends BaseController { | |||||
| FileOutputStream fos = null; | FileOutputStream fos = null; | ||||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | String imgFormat = ImgUtil.getImgFormat(fileFormat); | ||||
| if(StringUtils.isNotBlank(imgFormat)) { | if(StringUtils.isNotBlank(imgFormat)) { | ||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | |||||
| String tempFileName1 = UUID.randomUUID().toString(); | |||||
| String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName1 + fileFormat; | |||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | |||||
| BufferedInputStream fs = null; | BufferedInputStream fs = null; | ||||
| File localFile = new File(localImgFileName); | File localFile = new File(localImgFileName); | ||||
| fos = new FileOutputStream(localFile); | fos = new FileOutputStream(localFile); | ||||
| @@ -191,9 +190,8 @@ public class UploadController extends BaseController { | |||||
| fos.close(); | fos.close(); | ||||
| fs.close(); | fs.close(); | ||||
| logger.info("local file: " + localImgFileName); | logger.info("local file: " + localImgFileName); | ||||
| File newFile = ImgUtil.thinImage(localImgFileName, localNewImgFileName, imgFormat); | File newFile = ImgUtil.thinImage(localImgFileName, localNewImgFileName, imgFormat); | ||||
| logger.info("local new file: " + localImgFileName); | |||||
| logger.info("local new file: " + localNewImgFileName); | |||||
| // 删除本地缓存 | // 删除本地缓存 | ||||
| localFile.delete(); | localFile.delete(); | ||||
| ObjectMetadata metadata = new ObjectMetadata(); | ObjectMetadata metadata = new ObjectMetadata(); | ||||
| @@ -180,9 +180,8 @@ public class UploadController extends BaseController { | |||||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | String imgFormat = ImgUtil.getImgFormat(fileFormat); | ||||
| if(StringUtils.isNotBlank(imgFormat)) { | if(StringUtils.isNotBlank(imgFormat)) { | ||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | |||||
| String tempFileName1 = UUID.randomUUID().toString(); | |||||
| String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName1 + fileFormat; | |||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | |||||
| BufferedInputStream fs = null; | BufferedInputStream fs = null; | ||||
| File localFile = new File(localImgFileName); | File localFile = new File(localImgFileName); | ||||
| fos = new FileOutputStream(localFile); | fos = new FileOutputStream(localFile); | ||||
| @@ -175,8 +175,7 @@ public class UploadController extends BaseController { | |||||
| FileOutputStream fos = null; | FileOutputStream fos = null; | ||||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | String imgFormat = ImgUtil.getImgFormat(fileFormat); | ||||
| if(StringUtils.isNotBlank(imgFormat)) { | if(StringUtils.isNotBlank(imgFormat)) { | ||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | |||||
| tempFileName = UUID.randomUUID().toString(); | |||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | ||||
| BufferedInputStream fs = null; | BufferedInputStream fs = null; | ||||
| File localFile = new File(localImgFileName); | File localFile = new File(localImgFileName); | ||||