I am using gridfs-stream https://github.com/aheckmann/gridfs-stream & currently i am on displaying image from gridFS.
When reading data it gives me following out
I use file stream demonstrate:
var rstream = fs.createReadStream('test.png');
var bufs = [];
rstream.on('data', function(chunk) {
bufs.push(chunk);
}).on('end', function() { // done
var fbuf = Buffer.concat(bufs);
var base64 = (fbuf.toString('base64'));
res.send('<img src="data:image/jpeg;base64,' + base64 + '">');
});