Answers for "how to only accept video file in input"

-1

file accept videos

accept="video/mp4,video/x-m4v,video/*"
Posted by: Guest on March-27-2021
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 "how to only accept video file in input"

Browse Popular Code Answers by Language