7
When it is sent I do a validation checking if the chosen file is the format I need so:
function validaExtensao(id) {
var result = true;
var extensoes = new Array('xls'); // Arquivos permitidos
var ext = $('#' + id).val().split(".")[1].toLowerCase();
if ($.inArray(ext, extensoes) === -1) { // Arquivo não permitido
result = false;
}
return result;
}
Now I would like to filter when and open the input file to show only the corresponding file types.
Example:
Is it possible to do ? Cross-browser?
+1
, was just that, just a detail add her support in browsers, in some like IE9,iOS 9.2 and Opera do not work: http://caniuse.com/#search=Accept– Gabriel Rodrigues
Perfect, added the note, thanks for the touch, ;)
– Franchesco