Response.AppendHeader("Content-Disposition","attachment; filename="+HttpUtility.UrlEncode(strFileName,System.Text.Encoding.UTF8));
Response.WriteFile(filePath);
Response.End();
Response.WriteFile(filePath);
Response.End();
解决方案 »
- 像51选择行业添加多个模块问题
- C#下UrlReWrite 有什么好方案啊?
- 有谁知道My Yahoo的这种拖动效果是如何实现的?
- 如何更改WebPart中partstyle默认的:style="padding:5px"?
- 求救 关于CheckBoxList获取值的问题?
- 请教各位:这样的验证表达式如何写? 谢谢.
- 怎样使做的网站当别人收藏时,可以在收藏夹内自定义图标??像csdn收藏后一个红色的C字,其他都是IE的标志
- 怎么给自己写的类、控件加说明?
- 如何返回数据库中某表最新添加的行,在线等待,谢谢!!
- 我的SQL数据库安装的是实例,好象有问题哦!
- asp.net中,如何取得javascript 的 confirm 返回的数值
- 请问如何控制asp.net客户端(IE)的用户数
FileInfo fInfo=new FileInfo(path);
string fname=fInfo.Name;
Response.Clear();
Response.AddHeader("Content-Disposition","attachment;filename="+HttpUtility.UrlEncode(fname));
Response.AddHeader("Content-Length",fInfo.Length.ToString());
Response.ContentType="application/octet-stream";
Response.WriteFile(fInfo.FullName);
Response.Flush();
Response.End();
Response.AppendHeader("Content-Disposition", "");
Response.AppendHeader("Content-Length", "0");这里明显错误。
都开始让用户下载了,如何再修改http头呀