我试图使用accept type =“file”和accept来将字符串作为“.doc,.docx,.txt,.rtf”,但它仍然显示.csv.js和.spec.js文件
<input type="file"
accept=".doc,.docx,.txt,.rtf"./>
问题是accept参数使用MIME类型,因此它可能不起作用.doc对不同版本使用MIME类型:
.doc application/msword .dot application/msword
.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
.docm application/vnd.ms-word.document.macroEnabled.12
.dotm application/vnd.ms-word.template.macroEnabled.12