|
@@ -117,23 +117,24 @@ public class FileUploadUtils {
|
|
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
String extension = FileTypeUtils.getExtension(file);
|
|
|
- if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) {
|
|
|
- if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) {
|
|
|
- throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
|
|
|
- fileName);
|
|
|
- } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) {
|
|
|
- throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
|
|
|
- fileName);
|
|
|
- } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) {
|
|
|
- throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
|
|
|
- fileName);
|
|
|
- } else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) {
|
|
|
- throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
|
|
|
- fileName);
|
|
|
- } else {
|
|
|
- throw new InvalidExtensionException(allowedExtension, extension, fileName);
|
|
|
- }
|
|
|
- }
|
|
|
+ //取消文件扩展名校验
|
|
|
+// if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) {
|
|
|
+// if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) {
|
|
|
+// throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
|
|
|
+// fileName);
|
|
|
+// } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) {
|
|
|
+// throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
|
|
|
+// fileName);
|
|
|
+// } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) {
|
|
|
+// throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
|
|
|
+// fileName);
|
|
|
+// } else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) {
|
|
|
+// throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
|
|
|
+// fileName);
|
|
|
+// } else {
|
|
|
+// throw new InvalidExtensionException(allowedExtension, extension, fileName);
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|