修改上传问题

This commit is contained in:
sh
2026-07-22 12:15:35 +08:00
parent 163bbabcea
commit f331e4da8f

View File

@@ -101,7 +101,7 @@ public class FileValid {
private static String bytesToHex(byte[] bytes) { private static String bytesToHex(byte[] bytes) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (byte b : bytes) { for (byte b : bytes) {
sb.append(String.format("%02x", b)); sb.append(String.format("%02X", b));
} }
return sb.toString(); return sb.toString();
} }
@@ -128,7 +128,9 @@ public class FileValid {
case "docx": case "docx":
case "xlsx": case "xlsx":
case "pptx": case "pptx":
return magic.startsWith("504B0304"); return magic.startsWith("504B0304")
|| magic.startsWith("504B0506")
|| magic.startsWith("504B0708");
// 视频 mp4/mov/m4v // 视频 mp4/mov/m4v
case "mp4": case "mp4":
case "mov": case "mov":