如何检测文件下载请求

时间:2017-11-06 11:21:44

标签: c# .net proxy titanium-web-proxy

我遇到需要在运行Titanium-Web-Proxy的系统上阻止来自Web的所有文件下载请求/响应的情况。 如何识别所有阻止它们的请求/响应。

1 个答案:

答案 0 :(得分:0)

你无法找到非常简单的。

因为每个网站都使用自己的技术方式。你需要为个人网站做。

检查Request.Method =" POST"

到目前为止,我们检测到的网站很少

以下示例:

// Dropbox使用八位字节流请求块:

  if (url.Contains("/chunked_upload?") && url.Contains("chunk=0"))
  {
       //File Upload through this URL       
  }

// Yahoo使用savewithattachment方法

 if (url.ToLower().Contains("savewithattachment"))
 {
 //File Upload through this URL  
 }

// Office365使用

 if (url.ToLower().Contains("createattachment"))
 {
 //File Upload through this URL  
 }