Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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 = "";
    };
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #accept #video #input #type #file #size
ADD COMMENT
Topic
Name
6+1 =