add a maximum allowed size for a single upload

This commit is contained in:
Nicola Murino
2020-08-16 20:17:02 +02:00
parent 0dbf0cc81f
commit fa5333784b
21 changed files with 373 additions and 66 deletions

View File

@@ -504,6 +504,8 @@ func getUserFromPostFields(r *http.Request) (dataprovider.User, error) {
Filters: getFiltersFromUserPostFields(r),
FsConfig: fsConfig,
}
maxFileSize, err := strconv.ParseInt(r.Form.Get("max_upload_file_size"), 10, 64)
user.Filters.MaxUploadFileSize = maxFileSize
return user, err
}