Created
February 20, 2020 12:29
-
-
Save sainf/9da63a3f7d5c6b6e5110478f373bcc0d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
readFileAsync(file) { | |
return new Promise((resolve, reject) => { | |
let reader = new FileReader() | |
reader.onload = () => { | |
resolve(reader.result) | |
} | |
reader.onerror = reject | |
reader.readAsDataURL(file) | |
}) | |
} | |
let file = await readFileAsync(fileObject) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment