当前位置: 代码迷 >> 综合 >> input type=“file“ 文件上传类型限制
  详细解决方案

input type=“file“ 文件上传类型限制

热度:77   发布时间:2024-02-12 23:54:54.0
1、<input text="file" accept=".csv" />  cvs格式2、<input text="file"  accept="application/vnd.ms-excel"/>  上传.xls格式3、<input text="fiel" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>   上传.xslx格式4、<input type="file" accept="text/plain" />   上传.png/.jpg/etc格式5、<input type="file" accept="image/*" />   上传图片格式6、<input type="file" accept="text/html" />  上传.htm,.html格式7、<input type="file" accept="video/*" />   上传video(.avi, .mpg, .mpeg, .mp4)格式8、<input type="file" accept="audio/*" />   上传audio(.mp3, .wav, etc)格式9、<input type="file" accept=".pdf" />   上传.pdf格式10、<input type="file" accept=".zip" />   上传.zip格式11、<input type="file" accept=".zip" multiple />   上传多个(multiple)12、<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel">  如果限制两种文件格式,同时限制13、上传文件夹  (注意 : 上传文件夹 只能上传文件夹,不可以和文件同时上传)<input type="file" webkitdirectory />   上传文件夹 (webkitdirectory)

 

  相关解决方案