Created
March 21, 2022 03:25
-
-
Save donatj/349eff227295be423886e5bcc334caa8 to your computer and use it in GitHub Desktop.
Read File Inputs from JS (used in https://donatstudios.com/Read-User-Files-With-Go-WASM)
This file contains 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
fileInput.addEventListener('input', function(){ | |
fileInput.files[0].arrayBuffer().then(function(x){ | |
const data = new Uint8Array(x[0]); | |
// send the data to Go (it only accepts bytes as Uint8Array's | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment