最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Input file accept attribute not working - Stack Overflow

programmeradmin5浏览0评论

I want the user to select these files listed in the accept attributes. But its not allowing the user to select *.mov files. I am not sure why. Given below is the html I have used.

 <input type="file" tabindex="0"
                    accept="video/mov, video/3g2, video/3gp, video/3gp2, video/3gpp, video/asf, video/asx, video/avi, video/divx, video/m4v,  video/mp4, video/mpe, video/x-m4v, video/mpeg, video/mpg, video/ogg, video/wmv"
                    name="video">

I couldn't find much after googling. Any help is appreciated.

I want the user to select these files listed in the accept attributes. But its not allowing the user to select *.mov files. I am not sure why. Given below is the html I have used.

 <input type="file" tabindex="0"
                    accept="video/mov, video/3g2, video/3gp, video/3gp2, video/3gpp, video/asf, video/asx, video/avi, video/divx, video/m4v,  video/mp4, video/mpe, video/x-m4v, video/mpeg, video/mpg, video/ogg, video/wmv"
                    name="video">

I couldn't find much after googling. Any help is appreciated.

Share Improve this question asked May 10, 2017 at 7:23 KonzaKonza 2,17317 silver badges30 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 12

Try video/quicktime

See https://trac.webkit/browser/trunk/Source/WebCore/platform/MIMETypeRegistry.cpp for webkit MIME types

Well, given that the MIME type for QuickTime movies (.mov or .qt files) is video/quicktime and that's not in your list... :-)

MIME types are not just a category followed by a file extension. video/mov isn't, to the best of my knowlege, a defined MIME type. I'd also double-check video/3g2, video/3gp, video/3gp2, video/asf, video/asx, video/avi, video/m4v, video/mpe, video/mpg, and video/wmv, as I'm not sure any of those is a defined MIME type.

发布评论

评论列表(0)

  1. 暂无评论