user810606
user810606

Reputation:

How to move file from GridStore (GridFS) to File System for download?

I have some files in GridFS and I want to download them to the browser. It is my understanding that I need to take the file from GridFS and move it to the server's file system in order to send it to the browser.

Can someone point me in the right direction on how to do this? Specifically how to move the file from GridFS to the server's file system. I am using a node.js server with the Express.js module.

Upvotes: 0

Views: 1854

Answers (1)

g1ga
g1ga

Reputation: 322

Extracting the file to the filesystem it is not required. Have a look at this one (it works with an image, but I think you can do the math): https://stackoverflow.com/a/9848915/733749

Upvotes: 1

Related Questions