On the client side, how can I use the native browser filesystem API to embed base64 image data within an IMG element?
function createIMGFromFS () {
var img = document.createElement("img");
const openFile = async () => {
const [fh] = await window.showOpenFilePicker();
var file2 = await fh.getFile();
var name = file2.name;
var fr = new FileReader();
fr.readAsDataURL(file2);
fr.onloadend = function() {
img.src = fr.result;
}
}
const file = openFile();
return img;
}