Skip to content

Commit

Permalink
[fix] #50 modify to generate and return the external URL of the image (
Browse files Browse the repository at this point in the history
  • Loading branch information
chaewonni authored Jul 12, 2024
1 parent 7d38278 commit e3f9707
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public String uploadImage(String directoryPath, MultipartFile image) throws IOEx

RequestBody requestBody = RequestBody.fromBytes(image.getBytes());
s3Client.putObject(request, requestBody);
return key;
return s3Client.utilities().getUrl(builder -> builder.bucket(bucketName).key(key)).toExternalForm();
}

public void deleteImage(String key) throws IOException {
Expand Down

0 comments on commit e3f9707

Please sign in to comment.