csharp contentDisposition attachment http://test.greenbytes.de/tech/tc2231/#attwithfn2231utf8

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp contentDisposition attachment http://test.greenbytes.de/tech/tc2231/#attwithfn2231utf8相关的知识,希望对你有一定的参考价值。

string contentDisposition;
if (Request.Browser.Browser == "IE" && (Request.Browser.Version == "7.0" || Request.Browser.Version == "8.0"))
    contentDisposition = "attachment; filename=" + Uri.EscapeDataString(fileName);
else if (Request.Browser.Browser == "Safari")
    contentDisposition = "attachment; filename=" + fileName;
else
    contentDisposition = "attachment; filename*=UTF-8''" + Uri.EscapeDataString(fileName);
Response.AddHeader("Content-Disposition", contentDisposition);

以上是关于csharp contentDisposition attachment http://test.greenbytes.de/tech/tc2231/#attwithfn2231utf8的主要内容,如果未能解决你的问题,请参考以下文章

从 ContentDisposition 中丢失时如何在 MultipartStreamProvider GetStream 中获取文件大小

text contentDisposition attachment http://test.greenbytes.de/tech/tc2231/#attwithfn2231utf8

response.setHeader("Contentdisposition","attachment;filename="+URLEncoder.encode

Struts文件下载

Struts文件下载

struts文件下载机制