http://www.creativebloq.com/web-design/read-local-files-file-api-121518548
it shows exactly how you can do that:
The FileReader object allows us to read the content of a file once
we've got a file from the user. For security, the user must actively
give us the reference to the file in order for it to be readable.
There are a number of FileReader methods for getting a file's
contents
here is an example of how to use it: (code from the site)
var reader = new FileReader();
//create our FileReader object to read the file
reader.addEventListener("load", fileRead, false);
//add an event listener for the onloaded event
function fileRead(event){
//called when the load event fires on the FileReader
var pictureURL = event.target.result;
//the target of the event is the FileReader object instance
//the result property of the FileReader contains the file contents
}
reader.readAsDataURL(file);
//when the file is loaded, fileRead will be called