From bcf19f4f3e8d4da096ba7aedb3028107ba8352b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=87=89?= <927625802@qq.com> Date: Sun, 2 Jan 2022 14:51:27 +0800 Subject: [PATCH] :bug: fix upload get wrong content-type --- server/controllers/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/controllers/file.go b/server/controllers/file.go index 4ade2e5b188..b71035c7677 100644 --- a/server/controllers/file.go +++ b/server/controllers/file.go @@ -46,7 +46,7 @@ func UploadFile(c *gin.Context) { Size: uint64(file.Size), ParentPath: path_, Name: file.Filename, - MIMEType: c.GetHeader("Content-Type"), + MIMEType: file.Header.Get("Content-Type"), } err = driver.Upload(&fileStream, account) if err != nil {