54
rated 0 times
[
61]
[
7]
/ answers: 1 / hits: 34415
/ 7 Years ago, sat, october 14, 2017, 12:00:00
I am programming an application in angular2 that reads a csv file with a simply input in html:
<input type='file' name='userFile' id='file' >
I can access to the file at the component.ts:
ngOnInit() {
var input = (<HTMLInputElement>document.getElementById("file"));
input.addEventListener("change", function(event) {
var files = input.files;
var len = files.length;
if (len) {
console.log("Filename: " + files[0].name);
console.log("Type: " + files[0].type);
console.log("Size: " + files[0].size + " bytes");
}
}, false);
}
How can I read cell by cell a csv file uploaded using typescript, JavaScript or jQuery? (and which is the best way to do it).
More From » jquery