Upload filesize limit doesn't properly account for PHP max upload setting

Created on 22 October 2024, 5 months ago

Problem/Motivation

The file.default_max_filesize that can be set in the element settings form can be configured to be higher than the PHP max upload limit. If this is the case then the description of the file upload widget will show incorrect information about the size of files that can be uploaded.

Steps to reproduce

Edit php.ini to set an 8 MB file upload limit: upload_max_filesize = 8M.
Go to /admin/structure/webform/config/elements
Set Default maximum file upload size to a value that is higher than the PHP max upload limit (e.g. 200 TB).
Now go to a form that has a file element. The help text shows "One file only. 200 TB limit." while the actual limit is 8 MB.

Proposed resolution

We could set up a max value in the settings form that matches the PHP limit, but that would not solve the root of the problem, since the PHP limit can change at any time.

The best solution would be to take the PHP limit into account when determining the limit to show in the help text.

πŸ› Bug report
Status

Active

Version

6.3

Component

Code

Created by

πŸ‡§πŸ‡¬Bulgaria pfrenssen Sofia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024