incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goodall <matt.good...@gmail.com>
Subject Re: Adding jpeg Attachment
Date Sun, 10 May 2009 08:52:58 GMT
2009/5/10 Matt Goodall <matt.goodall@gmail.com>:
> 2009/5/10 z.ohnami <z.ohnami@gmail.com>:
>> Hi.
>>
>> I tested following command at couchdb 0.9.0.
>>
>>  $curl -X PUT http://192.xxx.yyy.zzz/database/document/test.txt?rev=nnn
>> -H "Content/Type: text/plain" -d @test.txt
>>
>> It worked well.I got the text data from Futon.
>> But next doesn't work well.I got file's URL from Futon instead of jpeg
>> data I PUT.
>>
>>  $curl -X PUT http://192.xxx.yyy.zzz/database/document/test.jpg?rev=nnn
>> -H "Content/Type: image/jpeg" -d @test.jpg
>>
>> Is my command wrong ?
>>
>
> The header should be Content-Type, not Content/Type.

Oh, and you also need to use --data-binary instead of -d if you're
sending binary data:

curl -X PUT http://192.xxx.yyy.zzz/database/document/test.jpg?rev=nnn
-H "Content-Type: image/jpeg" --data-binary @test.jpg

- Matt

Mime
View raw message