I use a api sails and mongo for storing images, side front nodeJs I want download X images, just one image, the code is functionally :
db.open(function (){
gfs.exist({ _id: id }, function(err, found) {
if (err) {
return err.negotiate(err);
}
if (!found) {
return res.negotiate('No file found');
}
gfs.createReadStream({ _id: id }).pipe(res);
});
});
For download x images......no ideas....
Thank you for your help
hope this helps.