I was wondering how to serve a file from a handler. I'm using go and gin and I've tried to do.
func DownloadHandler(c *gin.Context) {
c.File("./downloads/file.zip")
}
and
func DownloadConfigs(c *gin.Context) {
http.ServeFile(c.Writer, c.Request, "./downloads/file.zip")
}
and both of those solutions without the dot as well.
I'm open to any solution and because gin is compatible with the standard http lib, I can use non-gin specific solutions as well