file文件下载

会踩蘑菇的小菇娘 2017-02-13 05:19:07

想知道这个是用的什么让它弹出下载对话框的
...全文
160 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 4 楼 xdashewan 的回复:
[quote=引用 3 楼 qq_27325201 的回复:] HttpContext.Current.Response.ContentType = "application/octet-stream"; HttpContext.Current.Response.AddHeader("Content-Disposition", "attachement;filename=" + HttpUtility.UrlEncode(Path.GetFileN ame(filePath))); HttpContext.Current.Response.AddHeader("Content-Length", dataToRead.ToString()); 这样吗
是的[/quote] 谢谢帮助
xdashewan 2017-02-14
  • 打赏
  • 举报
回复
引用 3 楼 qq_27325201 的回复:
HttpContext.Current.Response.ContentType = "application/octet-stream"; HttpContext.Current.Response.AddHeader("Content-Disposition", "attachement;filename=" + HttpUtility.UrlEncode(Path.GetFileN ame(filePath))); HttpContext.Current.Response.AddHeader("Content-Length", dataToRead.ToString()); 这样吗
是的
  • 打赏
  • 举报
回复
HttpContext.Current.Response.ContentType = "application/octet-stream"; HttpContext.Current.Response.AddHeader("Content-Disposition", "attachement;filename=" + HttpUtility.UrlEncode(Path.GetFileN ame(filePath))); HttpContext.Current.Response.AddHeader("Content-Length", dataToRead.ToString()); 这样吗
cpycpy000 2017-02-13
  • 打赏
  • 举报
回复
自定义一个窗体,当你获得下载请求的时候弹窗就行了啊..
xdashewan 2017-02-13
  • 打赏
  • 举报
回复
http response头重的"Content-Disposition: attachment; filename=xxxx"

110,529

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧