No Code Attached Yet bug
avatar cybersalt
cybersalt
11 Oct 2025

Steps to reproduce the issue

Set the post_max_size and upload_max_filesize in PHP to 128M.

Set the maximum upload size in the Media Manager to 1M.

Use any extension with an upload field. The displayed limit is wrong (128M instead of 1M).

Uploading a 2M file fails.

Expected result

We should be told the limit is 1M.

Actual result

The displayed limit is wrong (128M instead of 1M).

System information (as much as possible)

Additional comments

avatar cybersalt cybersalt - open - 11 Oct 2025
avatar joomla-cms-bot joomla-cms-bot - change - 11 Oct 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Oct 2025
avatar brianteeman
brianteeman - comment - 11 Oct 2025

Are you sure it's not an issue with the extension. I only expect the media manager limit to be applied to the media manager component. All other extensions should either define their own limit or use the php settings. That's what happens for uploads with the template component

avatar leeroy1821
leeroy1821 - comment - 16 Oct 2025

I’ve run into this myself.

My configuration is:

  • PHP post_max_size = 128M
  • PHP upload_max_filesize = 80M
  • My extension's upload_maxsize = 20M

I should be able to upload files up to 20 MB. Joomla, however, reports in the file field layout that the maximum upload size is 80 MB. If I try to upload a file larger than 20 MB it simply fails.

This isn’t an issue with my extension. My extension’s config.xml correctly declares an upload_maxsize field as required by Joomla, and the user sets the limit there. In my code I call \Joomla\CMS\Helper\MediaHelper::canUpload() to verify that a file is safe before uploading – this helper reads the value the user supplied for upload_maxsize.

The problem is that the FileField does not display the correct upload limit when it’s used in an extension that defines its own upload_maxsize. Instead, Joomla reports the PHP lowest limit (in my case, 80 MB). This is a bug.

In #12396 the function \Joomla\CMS\Utility\Utility::getMaxUploadSize() was changed to return only the minimum of post_max_size and upload_max_filesize, completely ignoring any extension‑defined upload_maxsize.

The same PR also altered the FileField layout so that always it shows the maximum file size allowed for upload. It pulls this value from \Joomla\CMS\Utility\Utility::getMaxUploadSize(), which, as noted, now returns an incorrect result. Moreover, there is no way to override or hide this display.

What you need is:

  1. A property on the FileField that allows me to specify the name of the extension using it.
  2. An updated getMaxUploadSize() (or a new helper) that accepts that extension name, reads its declared upload_maxsize value, and returns the correct maximum upload size for that context.

With these changes the FileField will correctly show and enforce the per‑extension upload limit, and the bug in Joomla will be resolved.

(Translated and rewritten with ChatGPT. It is better than my bad English.)

avatar brianteeman
brianteeman - comment - 16 Oct 2025

Thank you for providing more (and useful) information

avatar Fedik Fedik - change - 16 Oct 2025
Labels Added: bug
avatar Fedik Fedik - labeled - 16 Oct 2025
avatar cybersalt
cybersalt - comment - 16 Oct 2025

Thanks @leeroy1821

@brianteeman - This is the first bug report I have ever tried and I expected a few more steps after putting in my report (ie which version of Joomla this was in.) Also, it turns out the email on my github account was a super long time ago one (who know why I created a Github account back then) so emails were going to a mailbox I don't check very often. I've fixed that now.

avatar brianteeman
brianteeman - comment - 20 Oct 2025

@cybersalt what was the extension you were using where you experienced the problem. It will help to ensure a fix works correctly without breaking something at the same time

avatar cybersalt
cybersalt - comment - 20 Dec 2025

@brianteeman - Sorry for not replying sooner - I travelled late October and injured myself on the 30th and up until now pain and poor health has had me falling farther and farther behind things. Revisiting this now, I don't have the cooperation of the developer to help explain this better and I don't want to get stuck in the middle of something that I must admit I don't have my mind wrapped around even after an hour of trying to sort things out myself. Lol, I am not even getting what AI tries to explain and the example it created for me to demonstrate. So not wanting to be "that guy" who posts something irrelevant or unrelated, I think it's better for me to just tip my hat to @leeroy1821 who seems to have the issue much firmer in hand. I apologize for any static I have added by trying.

Add a Comment

Login with GitHub to post a comment