Reputation: 142
I want to show in my html page an image that I've attached in a document on couchdb. How I can do this using javascript (jquery)?
I solved using
$.couch.db("mydb").view(...)
to obtain the id of document that I'm interesting. And
$.couch.db("mydb").openDoc(id, {...})
to obtain the image coded in base64. After that I put this base64's code in tag
<img src="data:image/jpg; base64, ...">
Upvotes: 0
Views: 748
Reputation: 12736
Actually you can do this by adding img
tag:
<img src="http://somehost/somedatabase/document/attachment">
Upvotes: 2