incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: Uploading attachments using Multipart/related
Date Tue, 25 Mar 2014 18:40:07 GMT

On Mar 25, 2014, at 7:37 AM, JC de Villa <> wrote:

> This is absolutely driving me nuts.
> I'm sure it's easy. Uploading multiple attachments just don't seem to want to work for

This sounds like my experience getting my replicator to interoperate with CouchDB a few years
ago :)

Here’s a brain dump of things I remember:

* Make sure the line breaks in the MIME separators/headers are CRLF, not just LF!
* CouchDB crashes if a multipart body is sent in HTTP ‘chunked’ mode (COUCHDB-1403, filed
by me two years ago and still unresolved. My colleague working on the Java port of my replicator
just ran into this a few weeks ago.)
* I remember there being a bug in CouchDB where it required a CRLF after the closing MIME
separator, i.e. the body had to end “--separator--\r\n” not just “--separator--“)
but I can’t find a reference to the bug in my source code anymore. It may have been fixed.
* CouchDB used to ignore the headers in attachment MIME parts and assumed that the attachments
appeared in the same order as in the “_attachments” object in the main JSON body. I believe
this has been fixed and that it now looks at the Content-Disposition header to find the attachment’s
filename, but I can’t remember for sure.

Hope this helps!

View raw message