As zed said in his comment the best way to do this is using attachments. The Wiki has a section on this: http://wiki.apache.org/couchdb/HTTP%5FDocument%5FAPI#Attachments
the basic idea is like so:
{
"_id":"attachment_doc",
"_attachments":
{
"foo.txt":
{
"content_type":"text\/plain",
"data": "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
}
}
}
You are correct that you should Base64 encode the attachments contents. You can have multiple attachments per document.
NOTE from the wiki: Please note that any base64 data you send has to be on a single line of characters, so pre-process your data to remove any carriage returns and newlines.