These are chat archives for gin-gonic/gin

7th
Oct 2015
Nick K
@utrack
Oct 07 2015 09:21
howdy! How do I write file to context.Writer?
Here's what I'm doing now:
    c.Writer.Header().Set("Content-Type", "text/csv; charset=utf-8")
        c.Writer.Header().Set("Content-Disposition", "attachment; filename=report.csv")
        c.Writer.WriteHeader(200)

        cwr := csv.NewWriter(c.Writer)
// stuff
cwr.Flush()
But when I point browser to this handler, the tab loads and then closes.
Nick K
@utrack
Oct 07 2015 09:29
nvm
it works, the download dialog was opening on another workspace -_-