This commit is contained in:
2023-07-17 16:01:39 +08:00
parent 06c543c564
commit cb5ac32f7b

View File

@@ -17,7 +17,8 @@ public class ZipUtil {
if (CollectionUtils.isEmpty(imageUrls)) {
return null;
}
File zipFile = new File("images.zip");
String fileName = "images-" + System.currentTimeMillis() + ".zip";
File zipFile = new File(fileName);
try (FileOutputStream fos = new FileOutputStream(zipFile); ZipOutputStream zos = new ZipOutputStream(fos)) {
for (int i = 0; i < imageUrls.size(); i++) {
String imageUrl = imageUrls.get(i);