1
Currently valid only file extension on input
file, need valid a file multiple
.
Code I have so far:
Html
<label>Arquivos .XML<br>
<input type="file" multiple name="arquivoXML[]" id="arquivoXml" required="true" accept=".xml">
</label>
Jquery
;(function($) {
$('#formulario').submit(function(e) {
var file = $('#arquivoXml').val();
var exts = ['xml'];
if ( file ) {
var get_ext = file.split('.');
get_ext = get_ext.reverse();
if ( $.inArray ( get_ext[0].toLowerCase(), exts ) > -1 ){
} else {
alert('Arquivo XML inválido');
e.preventDefault();
$("#arquivoXml").focus();
}
}
});
})(jQuery);