Displaying Images from MongoDB using GridFS


I am building that gallery webapp. I tried old method of saving images and retrieving it and it worked. But I couldnt upload large images. Its a common issue and got to know that I need to use GridFS. I am trying to fetch the file data but it aint working. Can anyone share a code snippet for fetching image from mongodb using gridfs and displaying it using Image()

It would be a great help

My current code is a mess so not able to share what I had typed

Hi. Image can be used with a StreamResource. There you can provide an Inputstream. GridFSDownloadStream implements InputStream interface. Never used GridFS so I can’t give you an example

I have had very bad performance issues with mongo fs and images to be shown in gallery. I switched to s3 on prem implementation with SeaweedFS.

how did u do that?

I tried this but Image shows nothing in UI

Use https://github.com/seaweedfs/seaweedfs stack with amazon S3 client