I have to validate the file size, which can not exceed 1024. How do I do this in TypeScript?
verificar(){
debugger;
let _this = this;
document.getElementById("openModalVerificar").click();
let formData: FormData = new FormData(),
xhr: XMLHttpRequest = new XMLHttpRequest(),
baseURL = Config.API;
if(_this.file!=null && _this.file!=undefined && _this.file[0].size > 1024){
for (let i = 0; i < _this.file.length; i++) {
formData.append("file", _this.file[i], _this.file[i].name);
}
} else {
swal ("Tamanho não permitido!")
}
but does not validate the file size.