我试过对文件名应用编码,但仍然在 response.BinaryWrite(data);
中获得了veracode错误以下是我的代码:
WebClient req = new WebClient();
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearContent();
response.ClearHeaders();
response.Buffer = true;
response.AddHeader("Content-Disposition", "attachment;filename=\"" + XSSSec.Encoder.HtmlEncode(FileName) + "\"");
byte[] data = req.DownloadData(FilePath);
response.BinaryWrite(data);
Response.Flush();
Response.SuppressContent = true;
有任何解决此问题的建议吗?