I would just check file.lastModified between the upload button clicks and if different reset the form values.
https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified
A better solution would be to read the file into an ArrayBuffer and upload that.