| | |
| | | /**
|
| | | * 默认大小 50M
|
| | | */
|
| | | public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
|
| | | public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024L;
|
| | |
|
| | | /**
|
| | | * 默认的文件名最大长度 100
|
| | |
| | | throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
| | | InvalidExtensionException
|
| | | {
|
| | | int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
| | | if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
| | | int fileNameLength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
| | | if (fileNameLength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
| | | {
|
| | | throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
| | | }
|