How can I use FileReader in wix Corvid

I want to read a image file using the FileReader. How can I use it? are there any other alternatives to it?

Yes you can use FileReader on Corvid

work example:

/* global FileReader */

$w.onReady(function () {
     const fileReader = new FileReader();

fetch('https://static.wixstatic.com/media/e3b156_8646d72618e3420db36dba9156d0b8e7~mv2.jpg/v1/fit/w_512,h_586/o_0.jpeg')
        .then(response => response.blob())
        .then(blob => fileReader.readAsArrayBuffer(blob));

    fileReader.onload = function () {
        // your buffer array here. But why you need it? )))
        console.log(fileReader.result);
    }
})
1 Like