Moved const 'defaultMemory' to attrib. Engine.MaxMultipartMemory instead. (#1100)
This commit is contained in:
committed by
Bo-Yi Wu
parent
848fa41ca0
commit
c9b344118f
@ -277,6 +277,8 @@ References issue [#774](https://github.com/gin-gonic/gin/issues/774) and detail
|
||||
```go
|
||||
func main() {
|
||||
router := gin.Default()
|
||||
// Set a lower memory limit for multipart forms (default is 32 MiB)
|
||||
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
|
||||
router.POST("/upload", func(c *gin.Context) {
|
||||
// single file
|
||||
file, _ := c.FormFile("file")
|
||||
@ -306,6 +308,8 @@ See the detail [example code](examples/upload-file/multiple).
|
||||
```go
|
||||
func main() {
|
||||
router := gin.Default()
|
||||
// Set a lower memory limit for multipart forms (default is 32 MiB)
|
||||
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
|
||||
router.POST("/upload", func(c *gin.Context) {
|
||||
// Multipart form
|
||||
form, _ := c.MultipartForm()
|
||||
|
Reference in New Issue
Block a user