Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I upload a file which is bigger then the max_upload in php.ini, the file upload field is replaced with a error message.
After this the upload field is gone and the form can't be submitted anymore.
I've looked into the code and narrowed it down to the following file: modules/file/file.module (line 245)
There's a ajax_command_replace function which replaces the input.
Comments
Comment #2
quicksketchUnfortunately this problem is basically insurmountable in Drupal. The only solution I can recommend is increasing the max file upload in PHP while keeping the limit in place within Drupal and Webform so that a proper error message can be returned.
If the max_file_upload size is exceeded, Drupal itself is never called. PHP bails out before it even calls Drupal. So it's not possible for Drupal to handle it more gracefully server-side. It may be possible to handle it better in the JavaScript, but that's an issue with core that affects Webform.