the element's value is cleared on click to allow selecting the same file...

The element's change event is not triggered when selecting the same file for a second time.
This fix will allow re-selecting the same file over-and-over by setting the element's value to null on the click event.