🪴 notes

Search

Search IconIcon to open search

reading content from Blob

Published Aug 2, 2023 Last updated Aug 3, 2023 Edit Source

src

1
2
3
4
5
6
7
8
var myBlob = new Blob(["Hello"], {type : "text/plain"});
var myReader = new FileReader();
//handler executed once reading(blob content referenced to a variable) from blob is finished. 
myReader.addEventListener("loadend", function(e){
	console.log(e.target.result);
});
//start the reading process.
myReader.readAsText(myBlob);

Might need this after getting file out of fetch response.