Please see these two minimum examples
<input type="file" accept="audio/mpeg">
<input type="file" accept="audio/mp3">
Both examples can select the only MP3, why is this happening?
If I want to force my user to just select an MP3 file, which code snippet should I use?
Which one is the best?
An MP3 is just the audio portion of a MPEG file, so specifying audio/mpeg
is equivalent to specifying audio/mp3
.
More info about media formats can be found in this article on MDN.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.