Hi Will
Curl (not CouchDB) is picking up artwork.jpg as a hostname. The clue
is in the PUT /albums/70b50bfa0a4b3aed1f8aff9e92dc16a0/
which should include the rev=... in a single line.
curl -vX
PUT http://127.0.0.1:5984/albums/70b50bfa0a4b3aed1f8aff9e92dc16a0/artwork.jpg?rev=1-d789a27476ed3962a24736e4138ff71f
--data-binary @artwork.jpg -H "Content-Type: image/jpg"
You probably have a space in between the doc & the attachment.
It works fine for me using following syntax, no quotes needed, which
barring whitespace seems to be exactly the same as yours.
thanks
Dave
C:\>curl -X GET
http://akai.muse.net.nz:5984/dumpy/dee941d577e31aa8e4ac34378700070e
{"_id":"dee941d577e31aa8e4ac34378700070e","_rev":"3-bf96dfa4770e3dbd2226c25baf007c92","camp":"couch","field":"hay","animal":"raccoon"}
C:\>curl -vX PUT
http://akai.muse.net.nz:5984/dumpy/dee941d577e31aa8e4ac34378700070e/attachment?rev=3-bf96dfa4770e3dbd2226c25baf007c92
--data-binary @D:\notes\curl_manual.txt -H "Content-Type: text/plain"
* About to connect() to akai.muse.net.nz port 5984 (#0)
* Trying 10.224.26.139... connected
* Connected to akai.muse.net.nz (127.0.0.1) port 5984 (#0)
> PUT /dumpy/dee941d577e31aa8e4ac34378700070e/attachment?rev=3-bf96dfa4770e3dbd2226c25baf007c92 HTTP/1.1
> User-Agent: curl/7.19.0 (i586-pc-mingw32msvc) libcurl/7.19.0 OpenSSL/1.0.0a zlib/1.2.3
> Host: akai.muse.net.nz:5984
> Accept: */*
> Content-Type: text/plain
> Content-Length: 126632
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< HTTP/1.1 201 Created
< Server: CouchDB/1.0.1 (Erlang OTP/R14B)
< Location: http://akai.muse.net.nz:5984/dumpy/dee941d577e31aa8e4ac34378700070e/attachment
< Etag: "4-2e84cffafa28e51e59c7d1a8393d24c9"
< Date: Sat, 11 Sep 2010 22:07:41 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 95
< Cache-Control: must-revalidate
<
{"ok":true,"id":"dee941d577e31aa8e4ac34378700070e","rev":"4-2e84cffafa28e51e59c7d1a8393d24c9"}
* Connection #0 to host akai.muse.net.nz left intact
* Closing connection #0
C:\>curl -X GET
http://akai.muse.net.nz:5984/dumpy/dee941d577e31aa8e4ac34378700070e
{"_id":"dee941d577e31aa8e4ac34378700070e","_rev":"4-2e84cffafa28e51e59c7d1a8393d24c9","camp":"couch","barbecue":"awesome
","animal":"raccoon","_attachments":{"attachment":{"content_type":"text/plain","revpos":4,"length":126632,"stub":true}}}
Couch has no table concept. Attachments aren't stored in tables, as
they are a key/value property of a doc.
What can't you do, that makes you think of handling _attachments differently.
NB these questions aren't couchapp ones, better sent to user@ in future.
cheers
Dave
> --
> You received this message because you are subscribed to the Google Groups "CouchApp" group.
> To post to this group, send email to couc...@googlegroups.com.
> To unsubscribe from this group, send email to couchapp+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/couchapp?hl=en.
>
>