下载pdf文件 [英] downloading pdf file

查看:64
本文介绍了下载pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在开发一个Web应用程序.在此应用程序中,用户可以下载存储在Sql Server中的文件.我的工作方式是在数据网格中显示文件列表.当用户单击gridview中的相应下载链接时,将从数据库中读取文件并将其写入Web服务器磁盘上的临时文件中.然后,我编写下面的代码以在客户端下载文件.

Hi
I am developing a web application. In this application a user can download a file stored in Sql Server. How i do it is that i show the list of files in a datagrid. When user clicks on a corresponding download link in gridview the file is read from database and written in a temporary file on web server disk. Then i write the below code to download the file on client side.

Response.ContentType = "application/pdf";
  Response.WriteFile("tempfile.pdf");
  Response.Flush();


一切正常,并且在客户端的浏览器中打开了pdf文件.但是我想做的是,不应在浏览器中打开pdf文件,我想在客户端显示一个保存文件"对话框选项,以便客户端可以将文件保存在其磁盘中而无需在Web浏览器中打开.

预先感谢您的任何答复.


All works fine and the pdf file gets opened in browser on client side. But what i want to do is that the pdf file should not be opened in browser, i want to show a save file dialog option on the client side so that client can save file in his disk without being opened in web browser.

Thanks in advance for any response.

推荐答案

这可能对您有所帮助:

http://aspalliance.com/259 [ ^ ]
This may help you:

http://aspalliance.com/259[^]


这篇关于下载pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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