Re: Writing files to database and avoiding the file system

20 views
Skip to first unread message

Jeremy Shaw

unread,
Sep 15, 2012, 5:28:45 AM9/15/12
to ha...@googlegroups.com

If you dig deeper in the BodyPolicy I believe you will find that you can provide your own fileWriter which gets chunks of data in an iteratee style. Let me know if you need more help. On my phone at the moment so I can't go into too much detail.

- Jeremy

On Sep 14, 2012 5:29 PM, "Richard Wallace" <rwal...@thewallacepack.net> wrote:
Hello,

I've noticed that with Happstack I seem to only have 2 options for handling the request body: 1) Read it all into memory as a ByteString or 2) if it's a file upload, have the file written to a temporary location on the filesystem.

In my case I'd like to write the file out to a distributed database rather than to the local filesystem.  I'd like to avoid the step of writing the file to the filesystem.  But putting the whole request body into memory isn't really an option either.

Is there any possibility of using one of the iteratee type libraries to read the request body in a more efficient way?

Thanks,
Rich

--
You received this message because you are subscribed to the Google Groups "HAppS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/happs/-/NVFaZhMmF1sJ.
To post to this group, send email to ha...@googlegroups.com.
To unsubscribe from this group, send email to happs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/happs?hl=en.

Richard Wallace

unread,
Sep 17, 2012, 1:23:09 PM9/17/12
to ha...@googlegroups.com
That looks like exactly what I need. Thanks!
Reply all
Reply to author
Forward
0 new messages