In my html page I create dynamically file input fields. For automatically upload the files I use on change event and ajax.
<input type="file" id="upload" multiple="multiple" />
$(function() {
$(document).on('click', '#upload', function() {
$(this).on('change', function() {
//upload file via ajax
alert('upload files');
});
});
});
This works fine but I have a problem when you cancelled the file selection and then you
rerun the selection of files to upload. The files are uloaded more times.
How can I fix this problem? Thanks