1、前端点击链接直接下载文件
_, excelFile := excel.BuildExcel(list)
c.Header("response-type", "blob")
data, _ := excelFile.WriteToBuffer()
c.Data(http.StatusOK, "application/vnd.ms-excel", data.Bytes())
_, excelFile := excel.BuildExcel(list)
c.Header("response-type", "blob")
data, _ := excelFile.WriteToBuffer()
c.Data(http.StatusOK, "application/vnd.ms-excel", data.Bytes())
本文标题:Gin 后台打包excel文件返回前端直接下载
本文链接:https://www.haomeiwen.com/subject/broftrtx.html
网友评论