I set up private file directory at /var/www/private to keep upload files from webform and setup permission on directory and files (664 for files, 775 for directories). When I click on upload button and select file, it throw an exception -
"An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (32 MB) that this server supports." However, file size is few kilobytes which is less than 1 MB but exception shows exceeded the maximum file size.

Note: Solution is running on Drupal 8.3 on VM (Vagrant)

Comments

bhagirajlimbu created an issue. See original summary.

jrockowitz’s picture

@bhagirajlimbu Welcome to the Drupal Community

I wanted the say "Hello" and encourage you to learn more about...

Watch video about helping us help you

jrockowitz’s picture

An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (32 MB) that this server supports.

Is a generic error that assumes the updated file exceeded the maximum file size but it could be permission or access rule or even a theme issue.

@see \Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber::onException


Other people are having this issue.

@see #2658718: Custom form AJAX error of upload file size shown even with no file field.

  • As a test, have you tried uploading files using the public file system?
  • Are you using a custom theme? Have you tested the issue using the Bartik theme?
  • Can you replicate the issue using a plain vanilla D8 instance?
jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)
jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
bhagirajlimbu’s picture

Thanks for sharing link. I found a cause which has not define early on template (twig) file :
{{ element.form_token }}
{{ element.form_build_id }}
{{ element.form_id }}
{{ element.actions }}
After define it allows browse file from local directory. However, error message is misleading.