'How could I display a non-image file stored in MongoDB(using GridFS) on a web page?

I am working on a site that allows a user to upload a document (not an image), which is then stored in MongoDB with GridFS. My question is... is it possible to then embed/display that document for viewing on the site? Everytime I use the createReadStream method, it just downloads the document. I would like it to show the actual document or the document's contents on the webpage, possibly in an iframe. Maybe there is a way to make a url for the document, or access the file another way? Thanks in advance.



Solution 1:[1]

<ifram

 <iframe src= 'https://www.vanmeegern.de/fileadmin/user_upload/PDF/Web_Development_with_Node_Express.pdf' frameborder="0" width="400px" height="600px"></iframe>

e>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mothule France