Oct-13-2020, 08:36 AM
I'm developing simple web application using flask , scrapy and mongodb. In my case crawl webpages and store some data in mongodb collection and represent using flask. I stored some images in mongodb as binary. Now I want to retrieve that binary data as images via flask. Currently I retrieved some stored data like this
<a href="{{ page._id.url }}">{{ page._id.title }}</a> <p class="mb-4">{{ get_excerpt(page._id.content, q) }}</p>Now I want to display the images which saved as binary in mongo collection. Collection name is 'page' and stored as
"image": { "$binary": { "base64": "iVBORw0KGgoAAAANSUhEUgAAAw8AABD+CAYAAAAbJKU5AAAAAXNSR0IArs4c6QAAIABJREFUeJzsvXmYJEd5J/yLyKyrr+nu0dwz/xaprA..................ACAs/weX+u+movGYcQAAAABJRU5ErkJggg=="Is there any way to do that?