Upload multiple files and some of them exceed the maximum file upload size. The UI show more than one file input box, after click remove button, all files removed.

What Drupal expected behavior is should show no file uploaded successfully.
Crashed layout

Comments

coolkind’s picture

Issue summary: View changes
coolkind’s picture

Issue summary: View changes
StatusFileSize
new34.66 KB
nikunjkotecha’s picture

I am facing similar issue but seems like the problem is different than the one explained above.

When using AJAX for form submission (CTOOLS or Drupal AJAX framework)

Scenario 1:

  • Keep the file field blank and click on save/submit button of the form
  • A server side error is generated (in my case) that the file is required
  • Client side validations of file size and file type are gone

Scenario 2:

  • Keep the file field blank and click on upload button of the form
  • Nothing happens and the form field is loaded again as is
  • Client side validations of file size and file type are gone

To fix this, for now I have disabled the submit/save and upload button until a valid file is uploaded, as for my case all files were required.

I am assuming that when an error comes events are not bound again to the same element. It works for second file field in case unlimited values are allowed and first file is uploaded properly.

flflfl’s picture

Hi,
Any suggestions about this issue?

ferrete’s picture

Same issue with me on D8. Any suggestions?

sushma22’s picture

Facing same issue with Drupal 10

Steps:

Issue is reproducible with multi file upload field

1.) upload 3 or more files. NOTE: except first or last file add any corrupted file in between i.e max size then expected
2.) go on preview of node
3.) back to node edit page
4.) You will see the file uploaded data is not loaded correctly, also if you try to remove file, ajax is not working correctly, GUI is also distorted.

I understand it's a complex scenario, but issue is there.

Thanks in advance