如何阻止asp.net上传发布的文件
我正在开发一个httpHandler,在我的源代码中如果某些条件不满足我想停止将文件上传到服务器(例如不允许文件扩展名)
当我尝试用
return null;
退出ProcessRequest
功能时,asp.net会在我退出httpHandler之前自动尝试并上传文件...
如何阻止asp.net自动上传发布的文件?
这是我到目前为止测试的东西清单,没有运气:
public void ProcessRequest(HttpContext context) {
var worker = (HttpWorkerRequest)provider.GetService(typeof(HttpWorkerRequest));
..........
worker.CloseConnection();
context.Response.End();
Environment.Exit(0);
return null;
}
没有找到相关结果
已邀请:
1 个回复
亥套惟间连