Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var file, buf, arr = new Array();
- $('body').append('<div style="position:absolute;top:0px;left:0px"><input id="flinp" type="file" name="fl"/></div>');
- $('#flinp').change(function(evt){
- var fr=new FileReader();
- fr.onload=(function(fil){
- return function(fl){
- console.dir(fil);
- console.dir(fl);
- file = fil;
- buf = new Uint8Array(fl.target.result)
- for(i in buf) if (buf.hasOwnProperty(i)) {
- if(! isNaN(i)) arr[i] = buf[i];
- }
- };
- })(evt.target.files[0])
- fr.readAsArrayBuffer(evt.target.files[0]);
- })
Add Comment
Please, Sign In to add comment