From 3111b8460dab8e1cc2d1ae096c9d14ef16cc3ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Wed, 6 Nov 2024 15:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=AB=AF=E3=80=90=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E3=80=91=EF=BC=9A=E5=9B=A0=E5=AE=B9=E6=98=93=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E8=AF=AF=E5=88=A4=EF=BC=8C=E5=8F=96=E6=B6=88=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=AB=AF=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=8C=85=E5=90=AB=E6=9C=A8=E9=A9=AC=E6=B5=81=E7=9A=84?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=BE=85=E6=89=BE?= =?UTF-8?q?=E5=88=B0=E6=9B=B4=E5=90=88=E7=90=86=E8=A7=A3=E5=86=B3=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E5=86=8D=E5=AE=8C=E5=96=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/CommonController.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CoreCms.Net.Web.WebApi/Controllers/CommonController.cs b/CoreCms.Net.Web.WebApi/Controllers/CommonController.cs index 0871cb75..8aa0c0fe 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/CommonController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/CommonController.cs @@ -373,16 +373,16 @@ namespace CoreCms.Net.Web.WebApi.Controllers } // 使用StreamReader来读取文件内容 - using (var reader = new StreamReader(file.OpenReadStream(), Encoding.UTF8)) - { - var content = await reader.ReadToEndAsync(); // 注意:这可能会消耗大量内存对于大文件,所以需要限制上传大小 - // 检查内容是否合法 - if (CommonHelper.CheckData(content)) - { - jm.msg = "请勿提交非法数据。"; - return jm; - } - } + //using (var reader = new StreamReader(file.OpenReadStream(), Encoding.UTF8)) + //{ + // var content = await reader.ReadToEndAsync(); // 注意:这可能会消耗大量内存对于大文件,所以需要限制上传大小 + // // 检查内容是否合法 + // if (CommonHelper.CheckData(content)) + // { + // jm.msg = "请勿提交非法数据。"; + // return jm; + // } + //} var url = string.Empty; if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.LocalStorage.ToString()) @@ -437,11 +437,11 @@ namespace CoreCms.Net.Web.WebApi.Controllers return jm; } - if (CommonHelper.CheckData(entity.base64)) - { - jm.msg = "请勿提交非法内容。"; - return jm; - } + //if (CommonHelper.CheckData(entity.base64)) + //{ + // jm.msg = "请勿提交非法内容。"; + // return jm; + //} //检查上传大小 if (!CommonHelper.CheckBase64Size(entity.base64, filesStorageOptions.MaxSize))