When it is sent I make a validation checking if the chosen file is of the format that I need:
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:
Typespecified:
Can it be done? Cross-browser?