| | |
| | | */
|
| | | public static final String extractFilename(MultipartFile file)
|
| | | {
|
| | | String fileName = file.getOriginalFilename();
|
| | | String extension = getExtension(file);
|
| | | fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
|
| | | return fileName;
|
| | | return DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + getExtension(file);
|
| | | }
|
| | |
|
| | | private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
| | |
| | | throws FileSizeLimitExceededException, InvalidExtensionException
|
| | | {
|
| | | long size = file.getSize();
|
| | | if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
|
| | | if (size > DEFAULT_MAX_SIZE)
|
| | | {
|
| | | throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
|
| | | }
|