Inappropriate message in function "file_ajax_upload()" of modules/file/file.module

Created on 26 April 2019, over 5 years ago
Updated 8 February 2024, 10 months ago

Hello,

In a website I manage, a content-type has one Image field (1 value possible) and one File field (unlimited values).

As anonymous user and only anonymous, if I populate the image input and then click on transfer (on Imce), no problem, the transer is done and i can see the preview of my image.

But after doing that if I populate the File input (with a 100 kb file) and click on transfer, the transfer fail with this message :

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

I've found where the error is :
In file.module line 245 (function "file_ajax_upload()"):

  if (empty($_POST['form_build_id']) || $form_build_id != $_POST['form_build_id']) {
    // Invalid request.
    drupal_set_message(t('An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (@size) that this server supports.', array('@size' => format_size(file_upload_max_size()))), 'error');
    $commands = array();
    $commands[] = ajax_command_replace(NULL, theme('status_messages'));
    return array('#type' => 'ajax', '#commands' => $commands);
  }

The problem is that since my first transfer (for the image), the $form_build_id and the $_POST['form_build_id'] are no longer equal.

The drupal set massage says it is because of the size. It is not appropriate.
By the way is there a solution to avoid this problem as anonymous user ?

Thanks for your reading.

πŸ› Bug report
Status

Closed: duplicate

Version

7.0 ⚰️

Component
File systemΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡«πŸ‡·France Actimage sxb

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024