Skip to content

Commit

Permalink
Fix: 파일 사이즈 Exception 값은 -1 로 나와서 하드코딩 및 transferManager shutdown 처리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey-Oh committed Mar 11, 2024
1 parent 256a035 commit 84adc93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sikdorok.appapi.infrastructure.aws;

import com.amazonaws.AmazonClientException;
import com.amazonaws.event.ProgressListener;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.model.*;
import com.amazonaws.services.s3.transfer.TransferManager;
Expand Down Expand Up @@ -86,6 +87,8 @@ public FileInfoDTO uploadFile(String path, MultipartFile uploadFile) {
log.error(e.getMessage());
}

transferManager.shutdownNow();

final String uploadFullPath = endpoint + uploadPath + "/" + uploadFileName;

return new FileInfoDTO(uploadPath, uploadFileName, originFileName, uploadFullPath, contentType, ext, size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public ErrorResponse maxUploadSizeExceededException(MaxUploadSizeExceededExcepti

return new ErrorResponse(
400,
"한번에 요청 가능한 파일 사이즈는 " + exception.getMaxUploadSize() + "MB를 초과할 수 없습니다."
"한번에 요청 가능한 파일 사이즈는 10MB를 초과할 수 없습니다."
);
}

Expand Down

0 comments on commit 84adc93

Please sign in to comment.