如何在CouchDB中显示文档附件中的图像? [英] How can I display an image out of a document's attachments in CouchDB?

查看:66
本文介绍了如何在CouchDB中显示文档附件中的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CouchDB来存储图像,我想知道如何从该CouchDD文档中获取图像以将其显示在HTML页面中。

I'm using CouchDB for storing images and I'd like to know how to get an image from that CouchDD document to display it in HTML page.

like :

<img src= ".....">

有没有我可以遵循的代码示例?

Are there any code examples I can follow?

推荐答案

您可以在BLOB字段中存储转换后的png-(jpg / gif)图像

You can store converted png-(jpg/gif) image in BLOB field

<img src="data:image/png;base64,<?php echo $base64PNGImage ?>">

这篇关于如何在CouchDB中显示文档附件中的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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