在asp.net中用Word打开二进制内容 [英] Open binary content in word in asp.net

查看:78
本文介绍了在asp.net中用Word打开二进制内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的应用程序中.我正在将pdf文件以二进制格式保存在数据库中.现在,我想获取二进制内容并使其在Pdf或Word女士中打开.

我该怎么做?我需要进行二进制转换吗?我对此一无所知.我需要你的建议.

在此先感谢

Hi All,

In my application. I am saving pdf files in database in binary form. Now i want to get the binary content and make it open in Pdf or in Ms Word.

How i can do this? Do i need to do the binary conversion? I have no idea about it. I need your suggestions.

Thanks in advance

推荐答案

您可以编写以下代码来实现它:

You can write the below code to achieve it:

Response.Clear()
Response.AppendHeader("Content-Disposition", "inline; filename=yourfile.pdf")
Response.ContentType = "application/pdf"
Response.BinaryWrite(binaryData)
Response.End()


这篇关于在asp.net中用Word打开二进制内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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