mirror of
https://github.com/gin-gonic/gin.git
synced 2026-06-12 08:38:16 +08:00
Merge 8c5e6b48d03b326c7f0b7d5cc544cd087db919f5 into 9914178584e42458ff7d23891463a880f58c9d86
This commit is contained in:
commit
21c2dbfb32
10
context.go
10
context.go
@ -690,12 +690,12 @@ func (c *Context) FormFile(name string) (*multipart.FileHeader, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
f, fh, err := c.Request.FormFile(name)
|
if c.Request.MultipartForm != nil && c.Request.MultipartForm.File != nil {
|
||||||
if err != nil {
|
if fhs := c.Request.MultipartForm.File[name]; len(fhs) > 0 {
|
||||||
return nil, err
|
return fhs[0], nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
f.Close()
|
return nil, http.ErrMissingFile
|
||||||
return fh, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MultipartForm is the parsed multipart form, including file uploads.
|
// MultipartForm is the parsed multipart form, including file uploads.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user