Skip to content
Advertisement

Error using async and await with filereader

I’m trying to read a file using FileReader:

JavaScript

However, evt.target.result still gets printed after my console.log(file) call.

Does anyone know how I can obtain the result of the file and pass it to my processFileContent function?

Advertisement

Answer

Use the new read methods on the blob itself

JavaScript

Alternative:

JavaScript
User contributions licensed under: CC BY-SA
11 People found this is helpful
Advertisement