二进制-Blob-URL
有file文件
let file = e.target.files[0];
let reader = new FileReader();
reader.readAsDataURL(file);
reader.onload=function(){
let obj = binaryFun(reader.result);
let blob = new Blob([obj.u8arr],{type:obj.mime});
let url = URL.createObjectURL(blob)
}
const binaryFun = binary => {
let arr = binary.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while(n--){
u8arr[n] = bstr.charCodeAt(n);
}
return {u8arr,mime}
}