0
I have to validate the file size, which cannot 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.
Valeu worked out that way, it wasn’t working out for just that, it was in bytes not in megas.
– Ian Luca