Make 'file' upload form field respect user quota better

Bug #1808245 reported by Robert Lyon on 2018-12-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Medium
Unassigned

Bug Description

Currently the 'file' form field doesn't do the following:

1) It doesn't display the max file size (the 'filebrowser' form field does this)

2) It returns the site's max file size on validation error even if a use has a quota value smaller

Things to change:

1) allow the maxfilesize value to be able to be set to user's max value if uploading into the user area, eg for importing skins/leap2a files - as the relating content of images/files will end up counted as user quota

2) allow the upload_manager() class to return error in correct max filesize

Robert Lyon (robertl-9) on 2018-12-12
Changed in mahara:
importance: Undecided → Medium
status: New → In Progress
milestone: none → 19.04.0
Steven (stevens-q) wrote :

Environment tested: Master
Browser tested: Chrome

Preconditions:
------------------------
1) config-defaults.php has the following line set — $cfg->maxuploadsize = 16777216; (16MB)
2) php.ini has the following line set — upload_max_filesize = 32M
3) exported skins file exists (17.5 MB)

Test Steps:
------------------------
1) Admin user log in
2) Browse to the following places and ensure that the text "(Maximum upload size 32MB)" is displayed near the upload button
--- a. admin menu > Users > Add users by CSV - CSV file upload ✔
--- b. admin menu > Configure site > Skins > Import skins - file upload ✔
--- c. admin menu > Group > Add groups by CSV - CSV file upload ✔
--- d. admin menu > Group > Update group members bt CSV - CSV file upload ✔
--- e. main menu > Manage > Import > Upload Leap2A file * - file upload ✔
--- f. main menu > Create > Resume > Education and employment > Education history - file upload ✔
--- g. main menu > Create > Resume > Education and employment > Employment history - file upload ✔
--- h. main menu > Create > Resume > Achievements > Certifications, accreditation and awards - file upload ✔
--- i. main menu > Create > Resume > Achievements > Books and publications - file upload ✔
--- j. main menu > Create > Resume > Achievements > Professional memberships - file upload ✔
--- k. admin menu > Configure site > Fonts > Install font - file upload ✔
--- l. admin menu > Configure site > Files - file upload ✔
3) Upload a file larger than the space will allow (ie. import a skins file)
4) Verify that the correct error message is displayed ✔

Catalyst QA Approved ✔

Reviewed: https://reviews.mahara.org/9371
Committed: https://git.mahara.org/mahara/mahara/commit/ad7d27ba6109230db37988c1d5bda9824f5dbb63
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit ad7d27ba6109230db37988c1d5bda9824f5dbb63
Author: Robert Lyon <email address hidden>
Date: Thu Dec 13 12:08:16 2018 +1300

Bug 1808245: Show max upload filsize for 'file' field

And allow one to set it to user max quota if needed

behatnotneeded

Change-Id: Ia689f8f7f61e81810559c6d170f5366379b3ea6d
Signed-off-by: Robert Lyon <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers