Merge 8c5e6b48d03b326c7f0b7d5cc544cd087db919f5 into ef68fa032c0e6ce637db56e89ec734c0de0a9f5e

This commit is contained in:
JuHyeon Jeong 2025-05-15 09:14:00 +02:00 committed by GitHub
commit 6b0f8eb462
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -662,12 +662,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.