How to get a blob?
HTML:
<input type="file" onchange="previewFile()">
JavaScript:
function previewFile() {
var file = document.querySelector('input[type=file]').files[0];
var reader = new FileReader();
// Get blob?
console.log(file);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…