😎去掉文件上传验证文件头类型

This commit is contained in:
zuohuaijun 2024-07-26 15:48:02 +08:00
parent 490a22126c
commit 144bb625db

View File

@ -340,8 +340,8 @@ public class SysFileService : IDynamicApiController, ITransient
// 防止客户端伪造文件类型
if (!string.IsNullOrWhiteSpace(allowSuffix) && !allowSuffix.Contains(suffix))
throw Oops.Oh(ErrorCodeEnum.D8003);
if (!VerifyFileExtensionName.IsSameType(file.OpenReadStream(), suffix))
throw Oops.Oh(ErrorCodeEnum.D8001);
//if (!VerifyFileExtensionName.IsSameType(file.OpenReadStream(), suffix))
// throw Oops.Oh(ErrorCodeEnum.D8001);
var path = string.IsNullOrWhiteSpace(savePath) ? _uploadOptions.Path : savePath;
path = path.ParseToDateTimeForRep();