Can we modify GridFs to stream directly from request to mongo w/o using temporary files internally?

77 views
Skip to first unread message

Ceecer Lamichhane

unread,
Oct 27, 2014, 5:21:57 AM10/27/14
to reacti...@googlegroups.com
Hi Stephane,

Cannot we get an enumerator from POST request to save the file? via the function directly as gridFs.save(enumertor, fileToSave) without storing the file as temporary.

What is the best approach for document sharing backend apis?

Any help would be greatly appreciated.

Thanks in advance.





Ceecer Lamichhane

unread,
Nov 4, 2014, 5:18:23 AM11/4/14
to reacti...@googlegroups.com

Hi, is there anybody who can help me answering my question?



Pedro De Almeida

unread,
Nov 5, 2014, 5:56:38 PM11/5/14
to reacti...@googlegroups.com
Hello Ceecer,

You can find a good example with the gridFSBodyParser helper on the reactivemongo-demo-app that stores uploaded files directly on MongoDB:

If you want to serve a file by streaming it, you can have a look to my ImageApiController example here:

(Please, note that this source may not be compatible with the latest ReactiveMongo version!)

Hope that this helps you ;)

Pedro

Ceecer Lamichhane

unread,
Nov 19, 2014, 12:36:26 AM11/19/14
to reacti...@googlegroups.com
Hi Pedro,

I couldnot understand that, does using the gridFsBodyParser stream the multipart file data to gridFs directly? or is this body parser also writing to /tmp in the disk in the middle and then doing gridFs.save(Enumerator.fromFile("/tmp/data.mov")...)?

Thanks,
Shishir



Reply all
Reply to author
Forward
0 new messages