ycl-server/src/main/java/com/ycl/task/ImageCompressTask.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ycl-server/src/main/java/com/ycl/task/ImageCompressTask.java
@@ -171,7 +171,11 @@ // ====================== 压缩逻辑结束 ====================== // 写入临时文件并替换原文件 tempFile = File.createTempFile("compressed_", "." + formatName); String tempFileName = "compressed_" + System.currentTimeMillis() + "." + formatName; tempFile = new File(localFile.getParentFile(), tempFileName); // 临时文件和原文件同目录 log.info("临时文件路径:{},原文件路径:{}", tempFile.getAbsolutePath(), localFile.getAbsolutePath()); try (OutputStream tempOs = new FileOutputStream(tempFile)) { byte[] buffer = new byte[1024]; int len;