我们使用file.slice(start,end)来切片文件的一部分(将被送到FileReader)。我想从最后读到,我们怎么能这样做?
var file = files[0];
var reader = new FileReader();
reader.onloadend = function(evt){
if(evt.target.readyState == FileReader.DONE){
console.log(a);
}
}
var blob = file.slice(0,5); // ----> ( I want to read 2 bytes from backward, For now I do, file.slice(fileSize-2). Is there another way guys ? )
reader.readAsArrayBuffer(blob);