<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
//url转blob
function urlToBlob() {
let file_url =
'http://obdataplatform-test.oss-cn-shenzhen.aliyuncs.com/2020_07_10/391f56b9-f4bc-408b-868b-31ea0f8b1b47.hex'
let xhr = new XMLHttpRequest();
xhr.open("get", file_url, true);
xhr.responseType = "blob";
xhr.onload = function () {
if (this.status == 200) {
// if (callback) {
// callback();
console.log(this.response)
const reader = new FileReader()
reader.onload = function () {
console.log('reader.result', reader.result)
}
reader.readAsText(this.response);
}
};
xhr.send();
}
urlToBlob()
</script>
</body>
</html>