I'm validating the attached file size on my page before upload using the following code:
var tamanhoArquivo = parseInt(document.getElementById("documento").files[0].size);
if(tamanhoArquivo > 2097152){ //MAX_FILE_SIZE = 2097152 Bytes
alert("TAMANHO DO ARQUIVO EXCEDE O PERMITIDO (2MB)!");
return false;
}
This validation is working perfectly in all browsers, except in version 8 of IE, where it says "Can not get '0' property of undefined or null reference."
Any suggestions for size validation also in IE 8?