如何从SQL DB下载PDF或图像文件? [英] How to Download PDF or Image files from sql DB?

查看:102
本文介绍了如何从SQL DB下载PDF或图像文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai朋友,
如何从应用程序文件夹下载文件.我有带有图像的墙纸文件夹.用户单击链接时,我需要从文件夹下载.

在此先感谢您.

Hai friends,
How to download a file from application foler. i have Wallpaper folder with images. i need to download from the folder when user clicks the link.

Thanks in advance.

推荐答案

,您可以使用Request.QueryString()
获取查询字符串. 但我不知道要从哪里下载图像的位置.您的图像/pdf文件是否在数据库中?或您的查询字符串包含它的路径.请具体说明.
you can get the query string using Request.QueryString()
but i cant figure out the location from where you want to download the image from. Is your image/pdf files in your database? or your query string contains the path to it. Please be specific.


图像以BLOB数据类型存储在sql server中.因此,查询表,从该列中获取值,并将其转换为适当的类型(图像流或其他输入流)和宾果游戏,即可得到文件.

了解有关Blob的更多信息.
Images are stored in sql server as BLOB data type. So query the table, get the value from that column and convert it to appropriate type (Image stream or other input stream) and bingo, you get the file.

Read more about Blob.


这篇关于如何从SQL DB下载PDF或图像文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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