Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 35761 invoked from network); 26 May 2009 13:57:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 May 2009 13:57:37 -0000 Received: (qmail 32504 invoked by uid 500); 26 May 2009 13:57:49 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 32452 invoked by uid 500); 26 May 2009 13:57:49 -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 32442 invoked by uid 99); 26 May 2009 13:57:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 May 2009 13:57:49 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of adam.kocoloski@gmail.com designates 209.85.221.203 as permitted sender) Received: from [209.85.221.203] (HELO mail-qy0-f203.google.com) (209.85.221.203) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 May 2009 13:57:39 +0000 Received: by qyk41 with SMTP id 41so2696996qyk.13 for ; Tue, 26 May 2009 06:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=7g0HA8pXIsA+ibTFotP0sPY/yaloV36X9jaf7f2kSqs=; b=LzZvmLYV7tNV4UH3Jjc7nHkE5poUKvCiUykuociqakBOYFH1I+2ztoXxxUOuaffdTT OmcIcs71IJXxCFkbLXshGH9e/FiUMaMOvgrl1m6k6cj5BG5hAH9Np3TidZnvJlQ+DT2c NMjqyltpge398UUZzlqDvT5j46VHmtJNCh49w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=DW9yxGc2TdLPfYe8Iizu4vI/PMsPb0Ahk0WVJrI+kM1wn86TvwCNipOitvxUhp7quC 5TCfBagfdu4Hwa+ZXmUHrPLtEjjqXgOmp/F5MIGrt1sa7tpFBcQ4005zTfglIXAu8Bux H2JWWNwrK/mAFKOOVAb5Y4nO9O7GEbg55u1VE= Received: by 10.224.46.8 with SMTP id h8mr7817744qaf.176.1243346238198; Tue, 26 May 2009 06:57:18 -0700 (PDT) Received: from COMPTON-FOUR-TWENTY-FIVE.MIT.EDU (COMPTON-FOUR-TWENTY-FIVE.MIT.EDU [18.109.6.170]) by mx.google.com with ESMTPS id 5sm1607557qwg.29.2009.05.26.06.57.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 26 May 2009 06:57:17 -0700 (PDT) Sender: Adam Kocoloski Cc: Darrell Huang Message-Id: <9429F4DE-6DB6-4516-A1F0-3B7E4FE4F6D6@apache.org> From: Adam Kocoloski To: user@couchdb.apache.org In-Reply-To: <20090526075927.GA9381@uk.tiscali.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: I need to know how to parse attachment data Date: Tue, 26 May 2009 09:57:15 -0400 References: <20090526075927.GA9381@uk.tiscali.com> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org On May 26, 2009, at 3:59 AM, Brian Candler wrote: > On Mon, May 25, 2009 at 12:07:55PM +0800, Darrell Huang wrote: >> Hi, everyone, I got some trouble in reading the attachment data from >> documents with the HTTP API. When an attachment is downloaded with >> the >> API, some extra data is found before and after the attachment data, >> and >> the data can be different at different times. >> For example, when I downloaded an attachment with the jpg format >> several >> weeks ago, there is a character sequence "dbc\r\n" preceding the >> actual >> file data, but when I did that today, it was "a24\r\n". > > That would be HTTP chunking, wouldn't it? If you send a request > advertising > HTTP/1.1 capability, then you are required to accept > Transfer-Encoding: Chunked > in the response. > > Regards, > > Brian. Yep, and those character sequences are hex representations of the length of the chunk. Adam