Guest User

Untitled

a guest
May 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var file, buf, arr = new Array();
  2. $('body').append('<div style="position:absolute;top:0px;left:0px"><input id="flinp" type="file" name="fl"/></div>');
  3. $('#flinp').change(function(evt){
  4.   var fr=new FileReader();
  5.   fr.onload=(function(fil){
  6.     return function(fl){
  7.       console.dir(fil);
  8.       console.dir(fl);
  9.       file = fil;
  10.       buf = new Uint8Array(fl.target.result)
  11.       for(i in buf) if (buf.hasOwnProperty(i)) {
  12.         if(! isNaN(i)) arr[i] = buf[i];
  13.       }
  14.     };
  15.   })(evt.target.files[0])
  16.   fr.readAsArrayBuffer(evt.target.files[0]);
  17. })
Add Comment
Please, Sign In to add comment