1.规定上传文件的类型
Valid Accept Types: For CSV files (.csv), use: <input type="file" accept=".csv" /> For Excel Files 2003-2007 (.xls), use: <input type="file" accept="application/vnd.ms-excel" /> For Excel Files 2010 (.xlsx), use: <input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" /> For Text Files (.txt) use: <input type="file" accept="text/plain" /> For Image Files (.png/.jpg/etc), use: <input type="file" accept="image/*" /> For HTML Files (.htm,.html), use: <input type="file" accept="text/html" /> For Video Files (.avi, .mpg, .mpeg, .mp4), use: <input type="file" accept="video/*" /> For Audio Files (.mp3, .wav, etc), use: <input type="file" accept="audio/*" /> For PDF Files, use: <input type="file" accept=".pdf" />
2.取消“未选择文件”的提示
title=""//设为空
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。