I have a form where users upload images. When an image is submitted it is validated against various criteria. If the validation fails the user is returned to the form but the failed file is still showing in the file upload element with the remove button.
I have been trying to find a way (with no success so far) to automatically remove the file if it fails validation so the user does not have to do it.
It doesn't bother me but the client has requested it so I need to do it somehow.