User tests: Successful: Unsuccessful:
Pull Request resolves #46267 .
The FileField currently displays the maximum upload size calculated from the PHP post_max_size and upload_max_filesize settings, but provides no way for an extension to specify a lower, field-specific upload limit.
This change adds support for a maxsize attribute to the FileField while still respecting the limits imposed by the PHP configuration.
For example:
<field
name="file"
type="file"
maxsize="20M"
/>
The displayed limit will be the lower of the field's maxsize value and the PHP upload limits.
Add a field to an existing form for example
<field
name="file"
type="file"
maxsize="20M"
/>
Open the form containing the file field.
Verify that the displayed maximum upload size is 20 MB.
Try again with a size greater than the php max upload size - verify that the diplayed maximum is now the php size and not the size from tyhe field definition
The FileField always displays the maximum upload size calculated from the PHP configuration.
A FileField can specify an extension-specific maximum upload size using the maxsize attribute.
The displayed maximum is the lowest of:
Existing FileField definitions without a maxsize attribute continue to use the existing PHP-derived limit.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Layout Libraries Unit Tests |
| Title |
|
||||||
I have tested this item ✅ successfully on f91b587
Works as expected.
I have tested this item ✅ successfully on f91b587
Works as expected.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48522.