Display image in HTML from GridFS
问题 I'm uploading an image in GridFS but have no idea how to display this in an <img > tag. I tried the following code: conn.once('open', function () { var gfs = Grid(conn.db, mongoose.mongo); gfs.files.find({ filename: 'img1.png' }).toArray(function (err, files) { if (err) { console.log(err); } console.log(files); }); }); I get the result: [ { _id: 5316f8b3840ccc8c2600003c, filename: 'img1.png', contentType: 'binary/octet-stream', length: 153017, chunkSize: 262144, uploadDate: Wed Mar 05 2014 15