如何在asp.net中下载带有路径的文件 [英] How to Download a file with a path in asp.net

查看:85
本文介绍了如何在asp.net中下载带有路径的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


如何从asp.net中的路径下载按钮单击事件时的Word文件.



谢谢与问候
莫哈末Wasif

Hi All,


How to download a word file on click event of button from a path in asp.net.



Thanks & Regards
Mohd. Wasif

推荐答案

您可以强制出现文件保存对话框.请参见此处 [ ^ ].
You can force the file save dialog to appear. See here[^].


在ASP.NET中下载文件并进行跟踪成功/失败的状态 [^ ]
在ASP.NET 2.0中动态呈现下载内容 [
File Download in ASP.NET and Tracking the Status of Success/Failure of Download[^]
Dynamically Render Download Contents in ASP.NET 2.0[^]


我认为您不想要简单的东西例如提供指向将要下载的文件的链接?这将是最简单的方法.您可以使用CSS给出您想要的任何外观.

否则,
http://msdn.microsoft. com/en-us/library/system.web.httpresponse.binarywrite%28v = vs.80%29.aspx [
I assume you don''t want something simple like providing a link to the file that will be downloaded? This would be the simplest way. You could use CSS to give just about any look you would like.

Otherwise, http://msdn.microsoft.com/en-us/library/system.web.httpresponse.binarywrite%28v=vs.80%29.aspx[^]


这篇关于如何在asp.net中下载带有路径的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆