You would need user consent if you want to do this. If you want to process it on the server then you can upload it there and process it and return user whatever you want to return. For client side processing you can use something like file reader like this:
document.getElementById('file').addEventListener('change', readFile, false);
function readFile (evt) {
var files = evt.target.files;
var file = files[0];
var reader = new FileReader();
reader.onload = function() {
console.log(this.result);
}
reader.readAsText(file)
}
but FileReader is only supported in IE 10 and 11 so you may run into issues there and Here is the jsfiddle:
http://jsfiddle.net/XRZNX/[
^]
Also have a look at this:
http://stackoverflow.com/questions/750032/reading-file-contents-on-the-client-side-in-javascript-in-various-browsers[
^]