forked from mirror/gin
doc: change the form name of upload example code (#3076)
This commit is contained in:
parent
5f0b6cdfc4
commit
ecadd82592
|
@ -385,7 +385,7 @@ func main() {
|
|||
router.MaxMultipartMemory = 8 << 20 // 8 MiB
|
||||
router.POST("/upload", func(c *gin.Context) {
|
||||
// Single file
|
||||
file, _ := c.FormFile("Filename")
|
||||
file, _ := c.FormFile("file")
|
||||
log.Println(file.Filename)
|
||||
|
||||
// Upload the file to specific dst.
|
||||
|
@ -417,7 +417,7 @@ func main() {
|
|||
router.POST("/upload", func(c *gin.Context) {
|
||||
// Multipart form
|
||||
form, _ := c.MultipartForm()
|
||||
files := form.File["Filename[]"]
|
||||
files := form.File["upload[]"]
|
||||
|
||||
for _, file := range files {
|
||||
log.Println(file.Filename)
|
||||
|
|
Loading…
Reference in New Issue