On Mar 25, 2014, at 7:37 AM, JC de Villa <[email protected]> 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 me. 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! —Jens
