Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个网站,当用户上传文件或文档时,它以 BLOB 数据类型存储在数据库中。还有一个下载链接,可以从数据库中检索文档并让用户下载。现在我想在像谷歌文档查看器这样的文档查看器中查看这个文档,我该怎么做呢?
如果您知道正在下载的文件的类型,您可以使用简单示例:
$blob = "some data"; header('Content-type: image/jpeg'); // e.g. if a JPEG image echo $blob;