Skip to content

Commit

Permalink
[update] #143 - s3이미지명 uuid로만 저장하게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
soljjang777 committed Dec 5, 2024
1 parent 6035742 commit 125e6aa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/com/wooribound/global/util/S3Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class S3Util {
// S3에 파일 업로드
public String uploadFile(MultipartFile multipartFile, String s3FolderName) {
try {
String uploadFileName = createFileName(multipartFile.getOriginalFilename());
// String uploadFileName = createFileName(multipartFile.getOriginalFilename());
String uploadFileName = createFileName();

ObjectMetadata metadata = new ObjectMetadata();
metadata.setContentType(multipartFile.getContentType());
Expand Down Expand Up @@ -63,7 +64,11 @@ public void deleteFile(String fileURL, String s3FolderName) {
}

// 파일 이름 생성 메소드
private String createFileName(String fileName) {
return UUID.randomUUID().toString().concat(fileName);
// private String createFileName(String fileName) {
// return UUID.randomUUID().toString().concat(fileName);
// }

private String createFileName() {
return UUID.randomUUID().toString();
}
}

0 comments on commit 125e6aa

Please sign in to comment.