Fork me on GitHub
#clojure-nl
<
2022-01-26
>
Thierry17:01:55

Does anyone have a link with info on how to serve something as .csv file from data created within a function as download (app uses ring and sibiro). I'm getting as far as that I can click a button on the webpage, the data gets pulled from the database, gets converted to csv and then I can only create a local csv file. I want the app to send it to my browser as download. I've been searching the web for about an hour now and came up quite empty

Thierry17:01:48

looked at that, but that requires a static file?

Thierry17:01:09

im now getting as far that a csv file is served, just has no content yet 🙂

arnout18:01:20

> and then I can only create a local csv file. I thought you had a file. If you have it in memory, then maybe it is just a matter of setting the right Content-Type header.

Thierry18:01:43

Got a bit further, It's pooping out a csv file for me but it containts the complete response {:status 200, :headers {"Content-Type" "text/csv"}, :body "csvbodydatahere"}

Thierry20:01:25

got it to work

Thierry20:01:43

didnt know how to handle the outputstream, gotta love stackoverflow