From user-return-22056-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sun Sep 9 21:28:25 2012 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A60E8DC8F for ; Sun, 9 Sep 2012 21:28:25 +0000 (UTC) Received: (qmail 53286 invoked by uid 500); 9 Sep 2012 21:28:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 53243 invoked by uid 500); 9 Sep 2012 21:28:23 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 53231 invoked by uid 99); 9 Sep 2012 21:28:23 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Sep 2012 21:28:23 +0000 Received: from localhost (HELO [192.168.1.5]) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Sep 2012 21:28:23 +0000 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Apple Message framework v1278) Subject: Re: Any way to upload a revision in pieces? From: Robert Newson In-Reply-To: Date: Sun, 9 Sep 2012 22:28:20 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <5BFA6443-8E2A-4884-88F0-1837C29FA0F3@apache.org> References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1278) No, there's no way to do that, since a document must change from one = revision to another atomically. The CouchDB replicator uses multipart/related PUT to send the document = and all attachments (streamed) in a single request. The = max_document_size (4gb, insanely, in couchdb, 64mb on cloudant) does not = apply to streamed attachments or the multipart/related PUT method. It = seems like you're asserting that TouchDB doesn't follow suit, which = would surprise me. B. On 9 Sep 2012, at 20:39, Jens Alfke wrote: > Is there any way to upload a single revision of a document (including = attachments) to CouchDB using multiple HTTP requests? >=20 > I ask because a developer using TouchDB has been having trouble = replicating from his iOS app to Cloudant. With some help from tech = support, he found that the app has some documents larger than 64MB (they = include large numbers of JPEG attachments), but Cloudant limits HTTP = request bodies to 64MB. >=20 > Apparently the Cloudant folks (whom I haven=92t talked with directly = yet) are saying TouchDB should be uploading =93standalone attachments=94; = but I don=92t know of any way in the API to upload the attachments of a = single revision individually. You can of course PUT to an attachment = URL, but that creates a _new_ revision for every attachment, so this is = not useable by the replicator since its job is not to create new = revisions but only to transfer existing ones. >=20 > I=92ve closed the bug report[1], suggesting that the developer should = change the document design to store fewer attachments in one doc, but = I=92m asking here in case there=92s some corner of the API that might = allow for a workaround. (Although I can=92t imagine what sort of state a = revision would be in when only a subset of its attachments have been = uploaded yet =97 it would have to be kept in some kind of limbo by the = server until all the attachments are added, since until then it=92s not = a true copy of the revision.) >=20 > =97Jens >=20 > [1] https://github.com/couchbaselabs/TouchDB-iOS/issues/159