2023-09-26
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user