Serving file with CouchDB attachment?
问题 Im using Express. i can't figure out how to send an image file to client in a way that it will be displayed to HTML tag <img src='/preview/?doc=xxxxxx&image=img1.jpg'> . I'm using Cradle getAttachment function to communicate with Couchdb https://github.com/flatiron/cradle db.getAttachment(id, filename, function (err, reply) { set('Content-Type', 'image/png'); res.end(reply); }); i don't know what reply is exactly and how to transfer that image to client without buffer 回答1: To transfer an