func FileDownload(c *gin.Context){ //c.Writer.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "test"))//fmt.Sprintf("attachment; filename=%s", filename)对下载的文件重命名 //c.Writer.Header().Add("Content-Type", "application/octet-stream") c.File("F:/go/demo/employ/files/5cdc28916a707.doc") }