Browse Source

修改内存上限

hsun 1 month ago
parent
commit
f71f03bd14
1 changed files with 2 additions and 2 deletions
  1. 2 2
      middleware/recover.go

+ 2 - 2
middleware/recover.go

@@ -16,9 +16,9 @@ import (
 func Recover() gin.HandlerFunc {
 	return func(c *gin.Context) {
 		contentType := c.ContentType()
-		// 为 multipart forms 设置较低的内存限制(50M) (默认是 32 MiB)
+		// 为 multipart forms 设置较低的内存限制(100M) (默认是 32 MiB)
 		if contentType == "multipart/form-data" {
-			err := c.Request.ParseMultipartForm(10 << 20)
+			err := c.Request.ParseMultipartForm(100 << 20)
 			if err != nil {
 				resp.Custom(http.StatusRequestEntityTooLarge, "上传文件太大,err:"+err.Error(), c)
 				c.Abort()