apache / nano

Nano is now part of Apache CouchDB. Repo moved to https://GitHub.com/apache/couchdb-nano

Home Page:https://github.com/apache/couchdb-nano

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

db.attachment.get file- 'could not be opened because it is empty'

themorganthompson opened this issue · comments

db.attachment.get(id, file, function(err, body) {
        if (!err) {
          fs.writeFile(req.file.name, body);
        }
    });

Upon opening the newly-written file, I see an error message that says, "[filename] could not be opened because it is empty."

If I make an http.get request via Postman, I can see the image fine. If I look at the attachment in Cloudant, I can see the image fine.