Open squarewav opened 3 years ago
If you use "Choose Files", upload a file, view the newly created file and then use the back button, the change event will trigger the file to be re-uploaded again. The fix is to do something like:
$('input[type=file]').change(function(e) { if (this.files.length > 0) { e.preventDefault(); $.each(this.files,function(k,file) { uploadFile(file); }); this.value = ''; } });
Meaning after the upload(s) just set this.value to reset this.files.FileList to no files.
If you use "Choose Files", upload a file, view the newly created file and then use the back button, the change event will trigger the file to be re-uploaded again. The fix is to do something like:
Meaning after the upload(s) just set this.value to reset this.files.FileList to no files.