attachments

francisco treacy francisco.treacy at gmail.com
Thu Oct 22 17:09:39 EDT 2009


Hi Justin,

2009/10/22 Justin Sheehy <justin at basho.com>:
> There is not currently any special "attachments" feature, but you can
> store anything in any object.  A basic pattern here is if you want an
> attachment, upload it as a separate document and have the "main"
> document include a link to the bucket and key of the attachment.
> There's no magic.

I am not sure I get you. AFAIK i can't just "store anything in any object":

$ curl -F "file=@jiak.rb" http://localhost:8098/jiak/album/file
> Poorly formed JSON Body.

Obviously, I should be posting a JSON structure with the buckets, key,
links and the object itself.
So if I follow this path, I need to include my attachment within that
JSON - which means I have to Base64-encode the file?

CouchDB used to handle inline attachments this way, until they
incorporated standalone attachments (as I think you suggest) in 0.9.
(Maybe [1] is of interest).

Thus my question is: how do I create a Riak document/resource with
only binary data (e.g. an image)?

Thanks,

Francisco

[1] http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments




More information about the riak-users mailing list