5
I am validating the size of the attached file on my page before uploading 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 for version 8 of IE, where it says "Unable to get the '0' property of indefinite or null reference".
Any suggestions for size validation also in IE 8?
Is there any other way to validate still in front-end in IE 8 and 9 ?
– Eduardo Nobre
I came here to answer this question, and I couldn’t find it. What I saw were people using java applets to do this treatment, however it was not very clear so I left it aside.
– Francisco Cabral