Search
 
SCRIPT & CODE EXAMPLE
 

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 = "";
    };
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript remoe last character from string 
Javascript :: selector jquery 
Javascript :: javascript get tag child elements 
Javascript :: how assign custom date to input type date in javascript 
Javascript :: post request with authorization 
Javascript :: javascript getters and setters 
Javascript :: ref in functional components 
Javascript :: uint8array javascript 
Javascript :: react sign in with linkedin 
Javascript :: obtener ancho de pantalla javascript 
Javascript :: nodejs delete object key 
Javascript :: js create object with keys 
Javascript :: react before css 
Javascript :: angular img src binding 
Javascript :: getting values for metaboxes in wordpress 
Javascript :: get static props 
Javascript :: online python to c converter 
Javascript :: json.stringify pretty 
Javascript :: Uncaught SyntaxError: Cannot use import statement outside a module 
Javascript :: react export 
Javascript :: How to reset ReactJS file input 
Javascript :: angular random number between 1 and 10 
Javascript :: loop javascript 
Javascript :: startswith vowels in js 
Javascript :: hackerearth javascript solutions 
Javascript :: get current location city name react native 
Javascript :: jquery element befor 
Javascript :: node powershell 
Javascript :: javascript reduce sum 
Javascript :: vue jest run single test 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =