|
|
@@ -4,6 +4,8 @@ import java.io.File;
|
|
4
|
4
|
import java.io.IOException;
|
|
5
|
5
|
import java.nio.file.Paths;
|
|
6
|
6
|
import java.util.Objects;
|
|
|
7
|
+
|
|
|
8
|
+import com.ruoyi.common.core.exception.file.FileException;
|
|
7
|
9
|
import org.apache.commons.io.FilenameUtils;
|
|
8
|
10
|
import org.springframework.web.multipart.MultipartFile;
|
|
9
|
11
|
import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
|
|
|
@@ -46,6 +48,9 @@ public class FileUploadUtils
|
|
46
|
48
|
{
|
|
47
|
49
|
return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
|
48
|
50
|
}
|
|
|
51
|
+ catch (FileException fe){
|
|
|
52
|
+ throw new IOException(fe.getDefaultMessage(), fe);
|
|
|
53
|
+ }
|
|
49
|
54
|
catch (Exception e)
|
|
50
|
55
|
{
|
|
51
|
56
|
throw new IOException(e.getMessage(), e);
|