From efe2673819144ff8cdf0c9a51d417bdeb0dc8e4b Mon Sep 17 00:00:00 2001 From: JongKeun Kim Date: Sun, 2 Jun 2024 16:11:18 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20s3=20=EC=A0=80=EC=9E=A5=20url=EC=97=90?= =?UTF-8?q?=20=EB=A7=8C=EB=A3=8C=EC=8B=9C=EA=B0=84=20=EB=B6=99=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20(#66)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/climingo/climingoApi/record/api/.gitkeep | 0 .../java/com/climingo/climingoApi/upload/S3Service.java | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) delete mode 100644 src/main/java/com/climingo/climingoApi/record/api/.gitkeep diff --git a/src/main/java/com/climingo/climingoApi/record/api/.gitkeep b/src/main/java/com/climingo/climingoApi/record/api/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/java/com/climingo/climingoApi/upload/S3Service.java b/src/main/java/com/climingo/climingoApi/upload/S3Service.java index 63ce88a..d32cd45 100644 --- a/src/main/java/com/climingo/climingoApi/upload/S3Service.java +++ b/src/main/java/com/climingo/climingoApi/upload/S3Service.java @@ -43,7 +43,7 @@ public String uploadVideoFile(MultipartFile videoFile) throws IOException { URL videoUrl = generatePermanentPresignedUrl(fileName.toString()); - return videoUrl.toString(); + return videoUrl.toString().substring(0, videoUrl.toString().indexOf("?")); } private File convertMultipartFileToFile(MultipartFile file) throws IOException { @@ -73,6 +73,8 @@ public String uploadImageFile(File image) { CannedAccessControlList.PublicRead)); image.delete(); - return generatePermanentPresignedUrl(fileName.toString()).toString(); + URL url = generatePermanentPresignedUrl(fileName.toString()); + + return url.toString().substring(0, url.toString().indexOf("?")); } }