ldnclj

Find us on #clojure-uk
thomas 2016-03-04T09:40:46.000388Z

morning

bahulneel 2016-03-04T10:39:47.000389Z

@rickmoynihan: I recently found this http://milinda.svbtle.com/handling-file-uploads-in-clojure-web-apps

2016-03-04T10:46:27.000391Z

@bahulneel: yeah that describes using the multi-part middleware - which is what we're using already... problem is I don't want to wrap the file in a form body - as its used by an API only... so I need another middleware to stream certain request bodies (depending on content type) into a temp file - and replace the body with the tempfile (like that middleware does).

bahulneel 2016-03-04T10:56:38.000392Z

@rickmoynihan: I see, something like https://gist.github.com/bahulneel/87ed9a13eeada08e93e7 would probably work

2016-03-04T10:59:05.000393Z

@bahulneel: yeah exactly - as you've demonstrated - it's easy enough to do - I was just wondering if there was an existing middleware for this...

2016-03-04T10:59:50.000394Z

thanks though... I might take what you've done and deploy a middleware for this usecase if there isn't an existing one already.

2016-03-04T11:01:38.000395Z

was thinking it might want to reuse bits from the multi-part middleware too though - e.g. the file store idea it has etc...

bahulneel 2016-03-04T11:02:11.000397Z

@rickmoynihan: That would make sense

2016-03-04T11:02:13.000398Z

also should probably take a set of content-types where it kicks in

2016-03-04T11:02:44.000399Z

I might take a look at this next week sometime