简体   繁体   English

在文档查看器中查看存储为BLOB数据类型的文档?

[英]viewing a document stored as BLOB datatype in document viewer?

i have a website in which when a user uploads a file or document it is stored in database in BLOB datatype. 我有一个网站,当用户上传文件或文档时,该网站以BLOB数据类型存储在数据库中。 Also there is a download link which retrives the document from database and lets the user download. 还有一个下载链接,可从数据库中检索文档并允许用户下载。 now i want this document to be viewed in a document viewer like google doc viewer,how do i go about doing this ? 现在,我希望在文档查看器(如google doc viewer)中查看此文档,我该怎么做?

if you know the type of the file being downloaded you can use some thing like Simple example: 如果您知道所下载文件的类型,则可以使用简单示例之类的方法:

$blob = "some data";

header('Content-type: image/jpeg'); // e.g. if a JPEG image
echo $blob;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM