go-common/app/admin/main/credit/http/export.go

15 lines
311 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package http
import (
"fmt"
bm "go-common/library/net/http/blademaster"
)
func outBuf(c *bm.Context, buf []byte, name string) {
c.Writer.Header().Set("Content-Type", "application/csv")
c.Writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s.csv", name))
c.Writer.Write(buf)
}