2023-09-26

This commit is contained in:
2023-09-26 15:20:47 +08:00
parent 1c28e4069e
commit d5d459bf1c
77 changed files with 10228 additions and 3160 deletions
@@ -42,6 +42,8 @@ namespace FineUIPro.Web.AttachFile
ResponseError(context);
return;
}
// 定义允许上传的文件类型列表
List<string> allowExtensions = BLL.DropListService.allowExtensions;
HttpPostedFile postedFile = context.Request.Files[0];
// 文件名完整路径
@@ -52,6 +54,15 @@ namespace FineUIPro.Web.AttachFile
string shortFileName = GetFileName(fileName);
string fileType = GetFileType(fileName);
if (!allowExtensions.Contains("." + fileType))
{
// 出错了
context.Response.StatusCode = 415;
context.Response.Write("不支持的文件类型");
// ResponseError(context);
return;
}
int fileSize = postedFile.ContentLength;
JObject fileObj = new JObject();