mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 12:12:12 +08:00
clean up the multipart request files
This commit is contained in:
parent
cf4775283e
commit
41308005db
@ -32,6 +32,14 @@ func (r *multipartRequest) TrySet(value reflect.Value, field reflect.StructField
|
||||
return setByForm(value, field, r.MultipartForm.Value, key, opt)
|
||||
}
|
||||
|
||||
// CleanUp clean up the multipart request
|
||||
func (r *multipartRequest) CleanUp() error {
|
||||
if r.MultipartForm != nil {
|
||||
return r.MultipartForm.RemoveAll()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setByMultipartFormFile(value reflect.Value, field reflect.StructField, files []*multipart.FileHeader) (isSet bool, err error) {
|
||||
switch value.Kind() {
|
||||
case reflect.Ptr:
|
||||
|
Loading…
x
Reference in New Issue
Block a user