|
|

public JsonResult ImportGroupScheduleFile(FormCollection form)
-
方法处理 POST 请求的文件上传,接收 FormCollection 参数。 -
文件通过 HttpPostedFileBase 从 Request.Files[“Import”] 获取 表单字段名为 “Import”

if (httpPostedFileBase.ContentType == "")
{
data = "导入文件格式错误!";
}
这个判断语句仅检查 ContentType 是否为空,没有对文件后缀进行检测,这里我们可以上传任意文件

接下来抓包构造文件上传数据包

成功上传,直接访问




没有回复内容