我的代码是这样的:
Response.AddHeader( "Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(path));
Response.WriteFile(path);
Response.End();path 是存在服务器上的附件的绝对路径。谢谢了
Response.AddHeader( "Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(path));
Response.WriteFile(path);
Response.End();path 是存在服务器上的附件的绝对路径。谢谢了
解决方案 »
- 如何在ListView内直接输出某字符串,不带span?在线等
- asp.net 导出EXCEL问题
- 怎样测试cookies跨域问题
- 有没有上海的兄弟知道上海甲子创意公司的?
- 取得treeview所有节点数目
- vs2005用ajax向页面输出字符,无法调试成功。有请高手相助。有代码。
- 在项目中的Styles。css这个文件有什么用啊??要怎么用啊 ??
- 小弟刚学完.NET,想找个小项目练练手,希望各位高手推荐书籍,需求分析源代码都要有的,网站也可以
- 错误提示!!!
- 再次问动态树的问题(如何把超连接加到树的节点上)
- 在DataGrid中,如何要让每行的LinkButton根据不同行的情况来显示或者灰化,我该怎么做啊???大虾
- **** 请教 EnCode 使用方法 *****
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();