title: Read file from local directory in Javascript
body: <p>I need to read a file from a specific path in the hard drive of my computer using Javascript (or using JQuery, it doesn't matter). I have been searching in Google but the things that I found are not really helpful. The closest thing that I have is:</p>
  
  <pre><code>  function readSingleFile(evt) {
      //Retrieve the first (and only!) File from the FileList object
      var f = evt.target.files[0]; 
  
      if (f) {
        var r = new FileReader();
        r.onload = function(e) { 
            var contents = e.target.result;
          alert( "Got the file.\n" 
                +"name: " + f.name + "\n"
                +"type: " + f.type + "\n"
                +"size: " + f.size + " bytes \n"
                + "starts with: " + contents.substr(1, contents.indexOf("\n"))
          );  
        }
        r.readAsText(f);
      } else { 
        alert("Failed to load file");
      }
    }
  
    document.getElementById('fileinput').addEventListener('change', readSingleFile, false);
  </code></pre>
  
  <p>It allows to select a file using a file chooser, and then it display the contents of the file. I need to do a program that reads a file in which you give the location explicitly, for example c:\files\test.txt, and it prints the contents of the test.txt file.</p>
  
  <p>I Googled this a lot without success, any help is welcome.</p>