【发布时间】:2014-01-22 03:29:10
【问题描述】:
这似乎对于过滤 image type 以进行文件上传非常有效
<input type="file" accept="image/*">
参考帖: File input 'accept' attribute - is it useful?
这似乎只适用于 Chrome:
<input type="file" name="imagefilename" accept="image/x-png, image/gif, image/jpeg" />
参考帖: How to allow <input type="file"> to accept only image files
问题: 我知道有一些方法可以使用 jQuery 或服务器端验证图像扩展......但是有没有人遇到任何属性,可以通过纯 html5 方式过滤图像,通过添加input type="file" 部分中的某些内容,如果不是跨浏览器,那么至少支持标准浏览器,例如 opera,moz,chrome,safari 和 IE9+????
请注意我要求纯 HTML 方式.....没有变通办法或黑客!!
询问的原因: 引用的线程已经很老了,我在 google 上找不到太多有用的东西....可能有人知道...!! :)
【问题讨论】:
标签: html image file-upload image-upload