Answer the question
In order to leave comments, you need to log in
How to display an image received from mongo?
Hello!
Picking a meteor. From base I receive object of a picture. But how to display it?
If you need _id, of course, we take the _id property. Some other property - we take it. But how to show the whole picture?
Thanks :)
ps GRIDFS add-on is used
Answer the question
In order to leave comments, you need to log in
files should be stored in files, not in the database.
but since you got in trouble
for displaying, you have two ways either to insert it into the body of data base64
or to make a separate route ( /image/14578.jpg ) which, by id, will output the body of the image to the output (res.send(post.image)) to the output +
add "Content-Type: image/jpeg" to headers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question