xlsx无法在formvalidation.io中运行?

时间:2017-08-18 11:01:20

标签: excel bootstrapvalidator formvalidation.io

我正在使用bootstrap formvalidation插件,但我想对输入类型文件进行验证,但问题是formvaliadtion.io不是选择xlsx格式而是处理xls。我想接受这两种格式(xls和xlsx)。这是我的代码: -

file: {
    validators: {
        file: {
            extension: 'pdf,doc,docx,xls,xlsx,jpeg,jpg,png',
            type: 'application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/jpeg,image/png',
            maxSize: 2097152,   
            message: 'The selected file is not valid and it should be less than 2mb'
           }
        }
    },

1 个答案:

答案 0 :(得分:1)

输入:'application / vnd.ms-excel,application / vnd.openxmlformats-officedocument.spreadsheetml.sheet'

Formatos: xlsx xls xlm xla xlc xlt xlw