Skip to content

Instantly share code, notes, and snippets.

@hadrysmateusz
Created January 3, 2020 01:39
Show Gist options
  • Save hadrysmateusz/ee0ddffc74584f753fbe2ebc2f2397ad to your computer and use it in GitHub Desktop.
Save hadrysmateusz/ee0ddffc74584f753fbe2ebc2f2397ad to your computer and use it in GitHub Desktop.
Markdium-Files in Client-Side JS: Ultimate Guide to Using Files in Web Applications
const reader = new FileReader()
// readyState is 0, result is null
reader.onload = () => {
// readyState is 2, result is the file's content
}
reader.onerror = () => {
// readyState is 2, result is null
}
// readyState is 0, result is null
reader.readAsText(file)
// readyState is 1, result is null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment