Answers for "accept only video file in html"

21

accept only image input file

<input type="file" name="myImage" accept="image/x-png,image/gif,image/jpeg" />
Posted by: Guest on February-19-2020
0

accept only video in input type file below size

var uploadField = document.getElementById("file");

uploadField.onchange = function() {
	// 2097152 ~ 2MB
    if(this.files[0].size > 2097152) {
       alert("File is too big!");
       this.value = "";
    };
};
Posted by: Guest on August-23-2021

Code answers related to "accept only video file in html"

Browse Popular Code Answers by Language