tags:

views:

137

answers:

1

How do I store standalone attachments in Couchdb using eCouch library.

Ecouch provides doc_create/3 and doc_Create/2, can we make use of any of these functions?

Did anyone has success in storing and retrieving attachments using eCouch?

Thanks in advance.

A: 

I checked out the source code and searched for the word "attachment", which returned zero results. Unless you hear otherwise or inspect the source code in detail (it's not that much), it's possible there are no direct attachment functions.

If that is so, you have two options.

  1. Send and receive using the CouchDB direct attachment API (i.e. /Db/Document/Attachment)

  2. Store the attachment inline in the document using _attachments.

Both are documented in the "Attachments" section of the CouchDB HTTP Document API in the wiki.

jhs