couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kocoloski <>
Subject Re: I need to know how to parse attachment data
Date Tue, 26 May 2009 13:57:15 GMT
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.


View raw message