You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by ugajin <ug...@zoho.com> on 2018/05/31 23:13:03 UTC

Re: Docs » 1. Introduction » 1.5.3. Documents > Attachments

Can anyone clarify this issue? The Docs provide the following bash/curl command:

curl -vX PUT http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af/artwork.jpg?rev=2-2739352689 \

     --data-binary @artwork.jpg -H "Content-Type:image/jpg"

..and continues

You should now see your artwork image if you point your browser to http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af/artwork.jpg



Is there something missing here? How can this posibly work without the said image file/Base64 encoded string containing the attachment data.



Thanks!



-u





Re: Docs » 1. Introduction » 1.5.3. Documents > Attachments

Posted by ugajin <ug...@zoho.com>.
Thanks a bunch.



-u





---- On Thu, 31 May 2018 23:48:40 +0000 Joel A &lt;oldsneerjaw@gmail.com&gt; wrote ----




ugajin, 



The "--data-binary" argument from the example curl command specifies what 

contents to send in the request body. The "@" in "@artwork.jpg" tells curl 

to read the data verbatim from the file at that path. So, in this case, 

you'd need a file call "artwork.jpg" in your current working directory for 

the command to work as is. 



Joel 





On Thu, May 31, 2018 at 4:13 PM, ugajin &lt;ugajin@zoho.com&gt; wrote: 



&gt; Can anyone clarify this issue? The Docs provide the following bash/curl 

&gt; command: 

&gt; 

&gt; curl -vX PUT http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8 

&gt; af/artwork.jpg?rev=2-2739352689 \ 

&gt; 

&gt; --data-binary @artwork.jpg -H "Content-Type:image/jpg" 

&gt; 

&gt; ..and continues 

&gt; 

&gt; You should now see your artwork image if you point your browser to 

&gt; http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af/artwork.jpg 

&gt; 

&gt; 

&gt; 

&gt; Is there something missing here? How can this posibly work without the 

&gt; said image file/Base64 encoded string containing the attachment data. 

&gt; 

&gt; 

&gt; 

&gt; Thanks! 

&gt; 

&gt; 

&gt; 

&gt; -u 

&gt; 

&gt; 

&gt; 

&gt; 

&gt; 







Re: Docs » 1. Introduction » 1.5.3. Documents > Attachments

Posted by Joel A <ol...@gmail.com>.
ugajin,

The "--data-binary" argument from the example curl command specifies what
contents to send in the request body. The "@" in "@artwork.jpg" tells curl
to read the data verbatim from the file at that path. So, in this case,
you'd need a file call "artwork.jpg" in your current working directory for
the command to work as is.

Joel


On Thu, May 31, 2018 at 4:13 PM, ugajin <ug...@zoho.com> wrote:

> Can anyone clarify this issue? The Docs provide the following bash/curl
> command:
>
> curl -vX PUT http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8
> af/artwork.jpg?rev=2-2739352689 \
>
>      --data-binary @artwork.jpg -H "Content-Type:image/jpg"
>
> ..and continues
>
> You should now see your artwork image if you point your browser to
> http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af/artwork.jpg
>
>
>
> Is there something missing here? How can this posibly work without the
> said image file/Base64 encoded string containing the attachment data.
>
>
>
> Thanks!
>
>
>
> -u
>
>
>
>
>