Skip to content

Instantly share code, notes, and snippets.

@M-Yankov
Created August 11, 2017 20:34
Show Gist options
  • Save M-Yankov/3eb51d86c3dc0458b729a4bdd183aabc to your computer and use it in GitHub Desktop.
Save M-Yankov/3eb51d86c3dc0458b729a4bdd183aabc to your computer and use it in GitHub Desktop.
How return raw image data from node js
// This gist shows how to return raw image data
// Of Course depends how the image is stored in the database.
// The image upload functionallity is implemented with `multer` library and directly stored in mongodb (not good practice, but...)
return res.end(images[0].buffer.buffer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment