Created
March 5, 2023 09:18
Revisions
-
tobychui created this gist
Mar 5, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ let input = document.createElement('input'); input.type = 'file'; input.multiple = true; input.onchange = e => { let files = e.target.files; for (var i = 0; i < files.length; i++){ let read = new FileReader(); read.readAsBinaryString(files[i]); read.onloadend = function(){ //Content of the file selected console.log(read.result); } } } input.click();