Today I accidentally found out that when you have a input with type file, and when you have chosen a file and then click the file button again but this time click cancel, the origin file is replaced and the file input remain no file chosen, which is pretty annoying especially I have something like a image preview with original image, and when the users do something like I mentioned before, they end up with nothing being uploaded.
<input type="file" />
I'm thinking using a hidden input to save the original file, like
<input type="file" id="origin"> <!--this would be hidden and save the file-->
<input type="file" ><!--show it to the user-->
and when I upload the image, I select the origin one and upload it..It's any better way to handle this situation?