修改文件上传添加msg类型白名单
This commit is contained in:
+5
-3
@@ -253,7 +253,9 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
String[] fileTypeArr = {".doc", ".DOC", ".txt", ".TXT", ".docx", ".DOCX",
|
||||
".xls", ".XLS", ".xlsx", ".XLSX", ".pdf", ".PDF", ".png", ".PNG",
|
||||
".jfif", ".JFIF", ".pjpeg", ".PJPEG", ".jpeg", ".JPEG", ".pjp", ".PJP",
|
||||
".jpg", ".JPG", ".swf", ".SWF", ".bmp", ".BMP", ".rar", ".RAR", ".zip", ".ZIP", ".ppt", ".PPT", ".pptx", ".PPTX", ".csv", ".CSV", ".gif", ".GIF"};
|
||||
".jpg", ".JPG", ".swf", ".SWF", ".bmp", ".BMP", ".rar", ".RAR", ".zip",
|
||||
".ZIP", ".ppt", ".PPT", ".pptx", ".PPTX", ".csv", ".CSV", ".gif", ".GIF",
|
||||
".msg", ".MSG"};
|
||||
boolean flag = true;
|
||||
for (String fileTypeTemp : fileTypeArr) {
|
||||
if (fileTypeTemp.equalsIgnoreCase(fileType)) {
|
||||
@@ -262,9 +264,9 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
}
|
||||
if (flag) {
|
||||
if (cut.equals(CutEnum.CN.getValue())) {
|
||||
throw new JeroBootException("只能够上传pdf/word/excel/csv/ppt/txt/zip/rar/gif/静态图片类型的文件。请重新选择文件!");
|
||||
throw new JeroBootException("只能够上传pdf/word/excel/csv/ppt/txt/zip/rar/msg/gif/静态图片类型的文件。请重新选择文件!");
|
||||
} else {
|
||||
throw new JeroBootException("Only upload pdf/word/excel/csv/ppt/txt/zip/rar/gif/Static image type file. Please re select the file!");
|
||||
throw new JeroBootException("Only upload pdf/word/excel/csv/ppt/txt/zip/rar/msg/gif/Static image type file. Please re select the file!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user