is currently uploading files.
needs to limit the file type to apk.
principle is an input. After the change event is triggered, the file is read, the type attribute is obtained, and the file type is judged according to the mime-type
. But in the latest version of Firefox (firefox), it is found that Firefox cannot get type, which is an empty string
chrome can be obtained.
is this person the bug of the browser? is there any workaround?
html
<input type="file" name="img" class="input1">
js
var file=document.querySelector(".input1");
file.onchange=function(e){
console.log(this.files[0]);//ff apk type
}