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