diff options
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/util')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/util/HttpUtils.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/juick-api/src/main/java/com/juick/api/util/HttpUtils.java b/juick-api/src/main/java/com/juick/api/util/HttpUtils.java index 93fb7874..ca75eae7 100644 --- a/juick-api/src/main/java/com/juick/api/util/HttpUtils.java +++ b/juick-api/src/main/java/com/juick/api/util/HttpUtils.java @@ -17,6 +17,7 @@ */ package com.juick.api.util; +import org.apache.commons.codec.digest.DigestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.multipart.MultipartFile; @@ -46,7 +47,7 @@ public class HttpUtils { if (attachmentType.equals("peg")) { attachmentType = "jpg"; } - String attachmentFName = UUID.randomUUID().toString() + "." + attachmentType; + String attachmentFName = DigestUtils.md5Hex(UUID.randomUUID().toString()) + "." + attachmentType; try { Files.write(Paths.get(tmpDir, attachmentFName), attach.getBytes()); |