I'm having trouble validating the files of a input
of type file
that has an array and is also a multiple
. As in the function below the variable filename only returns the name of the first file being there are 3 others or may be more. Has anyone gone through this?
function envia(){
var nomearquivo = document.getElementById('file').value;
var valor = nomearquivo.split("-");
var data = valor[0].slice(-8);
var n = data.split("");
var databr = n[0]+n[1]+'/'+n[2]+n[3]+'/'+n[4]+n[5]+n[6]+n[7];
var valida = valida_data_novo(databr);
if(valida){
document.forms[0].submit();
}
}
<INPUT TYPE="FILE" NAME="arquivo[]" ID="file" multiple/>