title: read in a file from url or filesystem to variable in javascript
body: <p>I am trying to read in a file from a file on my computer and store in in a variable.
  I am currently trying:</p>
  
  <pre><code>var fr = new FileReader;
  
  fr.onload = function() {
  
      //variable to hold file
      var data = fr.result;
  
      var c=document.getElementById("cvs");
      var ctx=c.getContext("2d");
      ctx.drawImage(img,0,0,200,180);
  };
  
  fr.readAsDataURL("encryptedImage");
  </code></pre>
  
  <p>this does not work. I need to do this do i can decrypt an encrypted image on my file system. I have already turned of the security so my file system can be read from a browser.</p>
  
  <p>any ideas?</p>