Compare commits
2 Commits
1b79a6cd36
...
c3c43b0079
| Author | SHA1 | Date |
|---|---|---|
|
|
c3c43b0079 | |
|
|
d33597766a |
|
|
@ -93,11 +93,6 @@ func DownloadFile(c *gin.Context) {
|
|||
defer file.Close()
|
||||
|
||||
// 设置响应头
|
||||
c.Writer.Header().Set("Content-Description", "File Transfer")
|
||||
c.Writer.Header().Set("Content-Transfer-Encoding", "binary")
|
||||
c.Writer.Header().Set("Expires", "0")
|
||||
c.Writer.Header().Set("Cache-Control", "must-revalidate")
|
||||
c.Writer.Header().Set("Pragma", "public")
|
||||
c.Writer.Header().Set("Content-Type", "application/octet-stream")
|
||||
c.Writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", file_.FileName))
|
||||
|
||||
|
|
@ -107,6 +102,8 @@ func DownloadFile(c *gin.Context) {
|
|||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Internal Server Error", "message": "Failed to send file"})
|
||||
return
|
||||
}
|
||||
|
||||
c.Status(http.StatusOK)
|
||||
}
|
||||
|
||||
func SetRedis(c *gin.Context) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue