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.
The setup: you have a file field which allows only .txt files.
Steps to reproduce: Click "Upload" before you choose a file, then click choose a file, and choose a .jpg file. Nothing happens. There should be an error message that comes up explaining that a .jpg file is not valid for this field.
Comments
Comment #1
crazybutable CreditAttribution: crazybutable commentedI tested this in 7.x, but needs verification that this is still a bug in 8.x.
Comment #2
swentel CreditAttribution: swentel commentedCan't reproduce this on 8.x - there is a different error (after you 'unhide' the upload button because it's hidden by default), but that will be fixed by #2587755: AJAX error when using progress bar on file field widget
Comment #3
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedThis is a special case of #1074214: Wrong file extension JS error is hidden after an upload has already been attempted (e.g., after adding then removing a file) and the patch there seems to fix it.