File upload elements on webform are not reflecting the limits specified on php.ini.

Created on 8 April 2025, 4 days ago

Problem/Motivation

File upload elements on webform are not reflecting the limits specified on php.ini.

Steps to reproduce

Ensure php.ini file contains the following setting:
memory_limit = -1
post_max_size = 50M
upload_max_filesize = 50M

When apache and drupal are restarted check php information to confirm that the settings are being applied (/admin/reports/status/php).

Create a new webform and '+ Add Element'. Search for file element. If you scroll down on the element configuration to the Maximum file size section, it states (Max: 5 MB). Set the Maximum File Size to 25 MB regardless and try to submit, I get an error stating, "Maximum file size must be lower than or equal to 5".

If I remove the above mentioned php configurations from php.ini and restart apache and drupal, I can see on the php information page that post_max_size is set to 8M and upload_max_filesize is set to 2M. However if I try to add a new file element on a new webform, I still get the (Max: 5 MB) and get the above mentioned error message if I try to submit anything above 5MB maximum file size. Did I miss something somewhere? I simply want to allow our users to be able to submit files up to 25MB in size. Any suggestions would be appreciated!

💬 Support request
Status

Active

Version

6.2

Component

Code

Created by

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

Comments & Activities

  • Issue created by @ubun2junky
  • Check the value of Default maximum file upload size at /admin/structure/webform/config/elements.

  • For anyone else that might be experiencing a similar issue as described above. Check the general form settings at (/admin/structure/webform/config/elements). There is a Default maximum file upload size and Default file upload limit per form sections. In my case these were set to 5MB. If you remove the values from these fields and leave them blank it will default to what you have set on your php settings. Hope this helps someone.

Production build 0.71.5 2024