Unit/System Tests PR-6.3-dev Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
29 Sep 2026

Pull Request resolves #46267 .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

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.

Testing Instructions

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

Actual result BEFORE applying this Pull Request

The FileField always displays the maximum upload size calculated from the PHP configuration.

Expected result AFTER applying this Pull Request

A FileField can specify an extension-specific maximum upload size using the maxsize attribute.

The displayed maximum is the lowest of:

  • The maxsize value specified by the field, when present.
  • PHP post_max_size.
  • PHP upload_max_filesize.

Existing FileField definitions without a maxsize attribute continue to use the existing PHP-derived limit.

image

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org: 734

  • No documentation changes for manual.joomla.org needed

avatar brianteeman brianteeman - open - 29 Sep 2026
avatar brianteeman brianteeman - change - 29 Sep 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Sep 2026
Category ⇒ Layout Libraries Unit Tests
avatar brianteeman brianteeman - change - 29 Sep 2026
Title
…
[6.3] maxsize for extensions
[6.3] file upload maxsize
avatar brianteeman brianteeman - edited - 29 Sep 2026
avatar brianteeman brianteeman - change - 29 Sep 2026
The description was changed
avatar brianteeman brianteeman - edited - 29 Sep 2026
avatar obuisard obuisard - test_item - 2 Oct 2026 - Tested successfully
avatar obuisard
obuisard - comment - 2 Oct 2026

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.

avatar obuisard
obuisard - comment - 2 Oct 2026

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.

avatar hans2103 hans2103 - test_item - 6 Nov 2026 - Tested successfully
avatar hans2103
hans2103 - comment - 6 Nov 2026

I have tested this item ✅ successfully on f91b587


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48522.

avatar hans2103
hans2103 - comment - 6 Nov 2026

I have tested this item ✅ successfully on f91b587


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48522.

avatar alikon alikon - change - 6 Nov 2026
Status Pending ⇒ Ready to Commit
avatar alikon
alikon - comment - 6 Nov 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48522.

avatar alikon
alikon - comment - 6 Nov 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48522.

avatar TLWebdesign
TLWebdesign - comment - 11 Nov 2026
avatar brianteeman
brianteeman - comment - 11 Nov 2026

Yes I can add that

avatar brianteeman brianteeman - change - 11 Nov 2026
The description was changed
avatar brianteeman brianteeman - edited - 11 Nov 2026
avatar brianteeman brianteeman - change - 11 Nov 2026
The description was changed
avatar brianteeman brianteeman - edited - 11 Nov 2026
avatar brianteeman brianteeman - change - 11 Nov 2026
The description was changed
avatar brianteeman brianteeman - edited - 11 Nov 2026
avatar brianteeman
brianteeman - comment - 11 Nov 2026

documentation added joomla/Manual#734

avatar TLWebdesign
TLWebdesign - comment - 11 Nov 2026

Thanks!

avatar TLWebdesign TLWebdesign - change - 16 Nov 2026
Labels Added: RTC Unit/System Tests PR-6.3-dev
avatar brianteeman
brianteeman - comment - 16 Nov 2026

I am closing this as on closer review it doesnt actually achieve what i intended - it just displays the reduced limit - it doesnt actually enforce it

avatar brianteeman brianteeman - change - 16 Nov 2026
Status Ready to Commit ⇒ Closed
Closed_Date 0000-00-00 00:00:00 ⇒ 2026-11-16 22:14:58
Closed_By ⇒ brianteeman
avatar brianteeman brianteeman - close - 16 Nov 2026
avatar brianteeman
brianteeman - comment - 16 Nov 2026

or should i just make the documentation clearer?

avatar brianteeman
brianteeman - comment - 17 Nov 2026

We could accept this PR as is but with corrected documentation

the documentation currently says
Note 2: You can put a soft limit file size by adding a hidden field with name="MAX_FILE_SIZE" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.

We could accept this PR with the documentation changed to

maxsize (optional) Specifies a maximum file size to display to the user.

Note 2: The maximum file size displayed is the lowest of:

  • The maxsize value specified by the field, when present.
  • PHP post_max_size.
  • PHP upload_max_filesize.
    Important: The maxsize attribute only affects the file size displayed to the user. It does not enforce an upload limit. Extensions must implement their own server-side validation to prevent files larger than the intended maximum from being uploaded.
avatar brianteeman brianteeman - change - 17 Nov 2026
Status Closed ⇒ New
Closed_Date 2026-11-16 22:14:58 ⇒
Closed_By brianteeman ⇒
Labels Removed: RTC
avatar brianteeman brianteeman - change - 17 Nov 2026
Status New ⇒ Pending
avatar brianteeman brianteeman - reopen - 17 Nov 2026
avatar brianteeman
brianteeman - comment - 17 Nov 2026
avatar brianteeman
brianteeman - comment - 17 Nov 2026

I leave it to maintainers to decide if this should be merged

Add a Comment

Login with GitHub to post a comment