如何在asp.net中创建“另存为"对话框以下载某些内容? [英] How to create a save as dialog box in asp.net to download some content ?

查看:105
本文介绍了如何在asp.net中创建“另存为"对话框以下载某些内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我单击时有一个超链接,我需要使用另存为"对话框下载一些文件.

I have a hyperlink on click of which i need to download some file using Save As Dialog box. How can this be implemented?

推荐答案



试试这个,你可以显示另存为对话框

Hi,

try this you can show saveas dialog box

Response.ContentType = "image/jpeg";
Response.AppendHeader("Content-Disposition","attachment; filename=SailBig.jpg");
Response.TransmitFile( Server.MapPath("~/images/sailbig.jpg") );
Response.End();



在这里,您可以根据需要更改contentType.

最好的



Here you can change contentType as your requirement.

All the Best


这篇关于如何在asp.net中创建“另存为"对话框以下载某些内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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