Why when I use the code below I never see 0 readyState even when the connection starts or is aborted?
You can check it here http://www.quemfazsite.com.br/teste1.php or using the code below
<input type="file" id="teste" />
<div onclick="aqui.abort();">abort</div>
<script type="text/javascript">
document.getElementById("teste").onchange = function() {
aqui = new XMLHttpRequest();
aqui.onreadystatechange = function() {
console.log(aqui.readyState);
};
aqui.open("POST","http://www.example.com",true);
var conteudo_arquivo = new FormData();
conteudo_arquivo.append("arquivo",document.getElementById("teste").files[0]);
aqui.send(conteudo_arquivo);
}
</script>