Compare commits

...

2 Commits

Author SHA1 Message Date
JuHyeon Jeong
557ffb5ee8
Merge 8c5e6b48d03b326c7f0b7d5cc544cd087db919f5 into d7776de7d444935ea4385999711bd6331a98fecb 2026-02-06 02:38:28 -04:00
정주현
8c5e6b48d0 refactor: Replace Request.FormFile 2023-04-25 15:29:32 +09:00

View File

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