aheckmann / gridfs-stream

Easily stream files to and from MongoDB
MIT License
615 stars 120 forks source link

Create WriteStream from binary data instead of filename #137

Closed aeon0 closed 6 years ago

aeon0 commented 6 years ago

I have binary data from a BSON object directly from an HTTP request. It includes some metadata and binary data I want to save to gridfs. As for now, I need to save the binary data to a file first before uploading to MongoDB with gridfs-stream and afterward, I delete the fail. It would be much more convenient if I could pass the variable which holds the binary data and stream that directly without generating a temp file.

This is not possible right now, or am I missing something?

aeon0 commented 6 years ago

Never mind, I have the binary data in a buffer and create a stream out of that... sorry for the spam!