- 方法一
handleBeforeUpload (file)const reader = new FileReader()reader.readAsArrayBuffer(file)reader.onload = async function (theFile) {const binary = new Blob([theFile.target.result]) // 转成二进制流数据 即binary数据格式}}
- 方法二
const aBlob = new Blob([file], { type: file.type })console.log(aBlob)