I have certain uploaded file code as following:
<script>
var input_file = document.getElementById('txt_list');
input_file.onchange = function() {
var file = this.files[0];
var reader = new FileReader();
reader.onload = function(ev) {
//myProcesses
};
reader.readAsText(file);
};
</script>
How can I add new function to determine the type of uploaded file either txt, gif, etc? and if i have to validate it, what am i supposed to do then? Thanks in advance