|
|
@ -216,9 +216,9 @@ public class FileUploadUtils { |
|
|
|
public static void assertAllowed(MultipartFile file, String[] allowedExtension) |
|
|
|
throws FileSizeLimitExceededException, InvalidExtensionException { |
|
|
|
long size = file.getSize(); |
|
|
|
if (size > DEFAULT_MAX_SIZE) { |
|
|
|
throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); |
|
|
|
} |
|
|
|
// if (size > DEFAULT_MAX_SIZE) { |
|
|
|
// throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); |
|
|
|
// } |
|
|
|
|
|
|
|
String fileName = file.getOriginalFilename(); |
|
|
|
String extension = getExtension(file); |
|
|
@ -250,9 +250,9 @@ public class FileUploadUtils { |
|
|
|
public static boolean checkFileValid(MultipartFile file) |
|
|
|
throws FileSizeLimitExceededException, InvalidExtensionException { |
|
|
|
long size = file.getSize(); |
|
|
|
if (size > DEFAULT_MAX_SIZE) { |
|
|
|
throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); |
|
|
|
} |
|
|
|
// if (size > DEFAULT_MAX_SIZE) { |
|
|
|
// throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); |
|
|
|
// } |
|
|
|
String[] allowedExtension = MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION; |
|
|
|
String fileName = file.getOriginalFilename(); |
|
|
|
String extension = getExtension(file); |
|
|
|