Created
August 11, 2017 20:34
-
-
Save M-Yankov/3eb51d86c3dc0458b729a4bdd183aabc to your computer and use it in GitHub Desktop.
How return raw image data from node js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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