As zed said in his comment, the best way to do this is to use applications. The Wiki has a section on this subject: http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments
The basic idea is this:
{ "_id":"attachment_doc", "_attachments": { "foo.txt": { "content_type":"text\/plain", "data": "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=" } } }
You are correct that Base64 encodes the contents of attachments. You can have multiple attachments for each document.
NOTE from the wiki: note that any base64 data you send must be on the same line of characters, so pre-process your data to remove any carriage returns and newlines.
source share