-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
decode attachments returned from get-document #49
Comments
|
The get-document doc-string says something about attachments: https://github.com/clojure-clutch/clutch/blob/master/src/com/ashafa/clutch.clj#L167, also see here: http://wiki.apache.org/couchdb/HTTP_Document_API#Getting_Attachments_With_a_Document It's been a while since I opened this issue but I seem to remember successfully getting attachments with a doc. This saves HTTP roundtrips when having several smallish attachments. For that case, smallish attachments, I now recommend just using plain base64 encoded fields in the main doc instead of attachments, less fuzz except you have to decode 'manually'. |
Oh, good point. I've never used this, simply because the attachments are returned base64-encoded, an obviously inefficient situation. In any case, automatically decoding that data wouldn't be appropriate; for all I know, a perfectly good use case involves moving that attachment data around in its encoded form. A more interesting prospect is supporting the MIME |
it seems "get-document" fetches attachments included with the document, however they are not decoded into binary. as an analogy to "put-document" which accepts binary attachments get-document should sort of present the "reverse" interface and decode them?
right now I can make use of "put-document" to add any number of attachments to a document in one go (call it bulk-attach if you want to) but in order to retrieve them as binary I have to retrieve them one by one using get-attachment.
thank you
The text was updated successfully, but these errors were encountered: