I have a JPS with a form in which a user can put an image:
Photo (max 240x240 and 100 kb):
const ValidateImg = (file) =>{ let img = new Image() img.src = window.URL.createObjectURL(file) img.onload = () => { if(img.width === 100 && img.height ===100){ alert("Correct size"); return true; } alert("Incorrect size"); return true; } }