Html5之input文件类型
05 Feb 2012代码格式:
1.<input type=”file” accept=”image/jpeg” >(单个图像类型)
2. <input type=”file” name=”pic” id=”pic” accept="image/gif, image/jpeg"
/>(多个图像类型)
3.<input type=”file” accept=”image/*” >(所有图像类型)
文件格式:
1.accept=”application/msexcel”
2.accept=”application/msword”
3.accept=”application/pdf”
4.accept=”application/poscript”
5.accept=”application/rtf”
6.accept=”application/x-zip-compressed”
7.accept=”audio/basic”
8.accept=”audio/x-aiff”
9.accept=”audio/x-mpeg”
10.accept=”audio/x-pn/realaudio”
11.accept=”audio/x-waw”
12.accept=”image/gif”
13.accept=”image/jpeg”
14.accept=”image/tiff”
15.accept=”image/x-ms-bmp”
16.accept=”image/x-photo-cd”
17.accept=”image/x-png”
18.accept=”image/x-portablebitmap”
19.accept=”image/x-portable-greymap”
20.accept=”image/x-portable-pixmap”
21.accept=”image/x-rgb”
22.accept=”text/html”
23.accept=”text/plain”
24.accept=”video/quicktime”
25.accept=”video/x-mpeg2″
26.accept=”video/x-msvideo”
测试:
1.所有图像格式:
<input id=”z” type=”file” name=”z” accept=”image/*” />
2.只支持word和jpeg
<input id=”z” type=”file” name=”z” accept=”application/msword,image/jpeg” />
3.只支持jpeg
<input id=”z” type=”file” name=”z” accept=”image/jpeg” />
转载请注明:于哲的博客 » Html5之input文件类型