|
|
@@ -58,8 +58,15 @@ public final class FileCheckRuleConfig {
|
|
|
* 文档规则
|
|
|
*/
|
|
|
public static final FileCheckRuleConfig DOCUMENT = builder()
|
|
|
- .withExtensions("pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt")
|
|
|
+ .withExtensions(
|
|
|
+ // ... 原有扩展名
|
|
|
+ "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt",
|
|
|
+ // 新增WPS扩展名
|
|
|
+ "wps", "et", "dps",
|
|
|
+ "wpt", "ett", "dpt" // 如果需要,也可以加上模板文件
|
|
|
+ )
|
|
|
.withMimeTypes(
|
|
|
+ // ... 原有MIME类型
|
|
|
"application/pdf",
|
|
|
"application/msword",
|
|
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
|
@@ -67,9 +74,31 @@ public final class FileCheckRuleConfig {
|
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
|
"application/vnd.ms-powerpoint",
|
|
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
|
- "text/plain"
|
|
|
+ "text/plain",
|
|
|
+ // 新增WPS MIME类型
|
|
|
+ "application/vnd.ms-works", // 常用于.wps
|
|
|
+ "application/wps-office.wps", // 更精确的.wps类型
|
|
|
+ "application/wps-office.et", // .et类型
|
|
|
+ "application/wps-office.dps", // .dps类型
|
|
|
+ "application/wps-office.wpt", // 如果需要模板
|
|
|
+ "application/wps-office.ett", // 如果需要模板
|
|
|
+ "application/wps-office.dpt" // 如果需要模板
|
|
|
)
|
|
|
.build();
|
|
|
+// /**
|
|
|
+// * 特殊文件类型规则
|
|
|
+// */
|
|
|
+// public static final FileCheckRuleConfig SPECIAL = builder()
|
|
|
+// .withExtensions("mp4", "mov", "avi", "wmv", "flv", "mkv")
|
|
|
+// .withMimeTypes(
|
|
|
+// "video/mp4",
|
|
|
+// "video/quicktime",
|
|
|
+// "video/x-msvideo",
|
|
|
+// "video/x-ms-wmv",
|
|
|
+// "video/x-flv",
|
|
|
+// "video/x-matroska"
|
|
|
+// )
|
|
|
+// .build();
|
|
|
/* ========== 组合类型规则 ========== */
|
|
|
/**
|
|
|
* 媒体规则(图片+视频)
|