I have a simple HTML form that sends an selected file via AJAX to an API endpoint.
If I do the following steps:
I managed to get a more descriptive error using the javascript File Reader. After the the file is changed and the button is pressed for the second time, the FileReader throws a somewhat more descriptive message:
DOMException: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.
At least this is an error that can be caught and displayed to the user, so they are aware that they need to re-select the file.
Here is the snippet:
Test
It seems that there is no way around this at the moment (June 2020). There is an open bug on Chromium:
https://bugs.chromium.org/p/chromium/issues/detail?id=1084880&q=ERR_UPLOAD_FILE_CHANGED&can=2