Max File Upload Size set to big, but Ajax Error with old file size I have changed the upload_max_filesize and the max body size in my php.ini to 15 MB. It used to be 2 MB. Drupal displays the max file size correctly, but when I try to upload files bigger than 2 MB - the old limit - I get an Ajax Error, telling me the entity is too large. Any idea where this comes from?
Just for documentation I'd like to add my findings here. I had this issue in Drupal 8, but I guess the Drupal version can be neglected to answer this question.



Suhosin

As @Clive already mentioned it in the comments to the question it's definitely worth a look under /admin/reports/status/php if the Suhosin PHP extension is enabled.

In https://www.drupal.org/node/725056 people suggest to disable this extension completely, but it's maybe better as @Clive suggested to simply override one of its parameters by editing your php.ini. Or by setting this in settings.php – if that is possible at all – via ini_set('suhosin.post.max_value_length', '-1'); or something like that. Maybe it's a different parameter you have to override.



Or Apache

If there's no Suhosin extension enabled, you may find this forum post valuable: https://www.drupal.org/forum/support/post-installation/2015-04-07/ajax-error-when-uploading-large-files where it's suggested to disable or reconfigure Apache's mod_security security mod.



Or JS

Last but not least you could simply try to circumvent Ajax completely by unbinding the event handler for the submit button, or by removing it completely.

Drupal 7

// Disable ajax upload for file field
drupal_add_js("jQuery(function() { jQuery('#edit-field-image :submit').unbind(); });", 'inline');


Source: How do I disable ajax on file fields?

Drupal 8

(function ($, Drupal) {
  Drupal.behaviors.autokill = {
    attach: function (context, settings) {
      // $('.form-managed-file &gt; input.form-submit').remove();
      $submit_button = $('.form-managed-file &gt; input.form-submit');
      $submit_button.unbind();
      $submit_button.removeClass('js-hide');
    }
  };
})(jQuery, Drupal);