Skip to content

CAS-58: Limit file size on upload

tran-dong.tran requested to merge feature/CAS-58_limit_file_size into develop

Description (from Jira)

We must ensure users do not flood the chat backend with large attachments at the start. There must be a configurable limit for uploaded files (for any type). Files exceeding the limit will be rejected in conjunction with a simple warning

"Uploaded file size exceeds the limit of $n MB"

Implementation notes

The easiest solution would be to check all uploaded files for size and reject the upload completely. It should be discussed if this is the wanted behavior, or if we want to e.g. upload 3 from 4 okay-files and reject only the file exceeding the limit.

Furthermore it should be discussed if a yell is a sufficient signal for the user, that the upload was "aborted", or if we need more visual indications.

Normally, if a file exceeds the file size limit (standard: 10MB), no request should be sent and a notification as a yell should be displayed. BUT: Currently we have no way of syncing the settings between the MW and UI. As long as that's the case, we do send a request to the MW and reject it there. The response from the MW should be processed. Depending on the response error code (in this case 'filesize:exceeded') different error messages should be displayed.

Edited by tran-dong.tran

Merge request reports