File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/main/java/com/recordit/server/util Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public String upload(@NonNull MultipartFile multipartFile) {
2929 amazonS3 .putObject (
3030 new PutObjectRequest (
3131 s3Properties .getBucket (),
32- fileName ,
32+ s3Properties . getDirectory () + "/" + fileName ,
3333 multipartFile .getInputStream (),
3434 getObjectMetadataBy (multipartFile )
3535 ).withCannedAcl (CannedAccessControlList .PublicRead )
@@ -41,7 +41,7 @@ public String upload(@NonNull MultipartFile multipartFile) {
4141 }
4242
4343 public String getUrlByFileName (String fileName ) {
44- return amazonS3 .getUrl (s3Properties .getBucket (), fileName ).toString ();
44+ return amazonS3 .getUrl (s3Properties .getBucket (), s3Properties . getDirectory () + "/" + fileName ).toString ();
4545 }
4646
4747 private ObjectMetadata getObjectMetadataBy (@ NonNull MultipartFile multipartFile ) {
You can’t perform that action at this time.
0 commit comments