Max_File_Size setting in System Console > File Settings (#3070)

This commit is contained in:
Thomas Balthazar
2016-05-24 15:07:42 +02:00
committed by Harrison Healey
parent 8e5c318590
commit 7e2b539de4
9 changed files with 48 additions and 16 deletions

View File

@@ -1178,13 +1178,13 @@ func uploadProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if r.ContentLength > model.MAX_FILE_SIZE {
if r.ContentLength > *utils.Cfg.FileSettings.MaxFileSize {
c.Err = model.NewLocAppError("uploadProfileImage", "api.user.upload_profile_user.too_large.app_error", nil, "")
c.Err.StatusCode = http.StatusRequestEntityTooLarge
return
}
if err := r.ParseMultipartForm(model.MAX_FILE_SIZE); err != nil {
if err := r.ParseMultipartForm(*utils.Cfg.FileSettings.MaxFileSize); err != nil {
c.Err = model.NewLocAppError("uploadProfileImage", "api.user.upload_profile_user.parse.app_error", nil, "")
return
}