我使用的是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'
}
}
},发布于 2017-11-08 06:47:47
类型:'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet‘
格式:xlsx xls xlm xla xlc xlt xlw
https://stackoverflow.com/questions/45755089
复制相似问题