Skip to content

Commit

Permalink
[Fix] : 이미지 용량 예외처리 20MB로 증량
Browse files Browse the repository at this point in the history
  • Loading branch information
wellbeing-dough committed Dec 7, 2023
1 parent 7be769e commit fc13fbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class ImageSizeException extends CustomException {

private final StatusType status;

private static final String message = "이미지의 크기는 1MB 미만이어야 합니다.";
private static final String message = "이미지의 크기는 20MB 미만이어야 합니다.";

public ImageSizeException() {
super(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class UserImageService {

public void uploadUserImage(Long userId, MultipartFile multipartFile) throws IOException {
UserEntity user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new);
if(multipartFile.getSize() >= 1024 * 1024) { throw new ImageSizeException(); }
if(multipartFile.getSize() >= 20 * 1024 * 1024) { throw new ImageSizeException(); }
user.updateImage(saveImage(multipartFile));
}

Expand Down

0 comments on commit fc13fbc

Please sign in to comment.