couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevebest <>
Subject [GitHub] couchdb-nano issue #36: Streamable multipart attachments are not supported
Date Mon, 20 Mar 2017 06:07:35 GMT
GitHub user stevebest opened an issue:

    Streamable multipart attachments are not supported

    Consider a scenario when you want to upload a document and several attachments to a CouchDB
in a single request - a typical example would be uploading a "Couchapp": a design doc with
multiple HTML/JS/CSS attachments. This scenario is [supported by CouchDB API](
using `Content-Type: multipart/related` request. Furthermore, you could expect to leverage
Node `Stream`s in order to avoid the necessity of buffering a bunch of files in memory. Unfortunately,
the combination of issues in CouchDB and `request` prevents this.
    1) CouchDB has [a nasty bug]( which
prevents from using `Transfer-Encoding: chunked` along with `Content-Type: multipart/related`.
It won't be fixed until `1.7`, and its status in `2.x` branch is unknown.
    2) `request` uses exactly the `Transfer-Encoding: chunked` to upload data from `Stream`s.
    3) `request` could be told explicitly not to use `chunked` encoding - but then you can't
give it any `Stream`s! See [docs for a `multipart` option in request(options, callback)](
    Technically, it should be possible to stream a bunch of attachments, in case where one
knows the length of the stream beforehand (which is not a problem when you upload files from
a disk). I attempted to add the support for this case in dscape/nano#300, but failed miserably
because `request` rightfully thinks it's smarter than me.



If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message