Ricorda: funziona solo con IE, negli altri il file viene inviato in ogni caso.codice:<script> var maxFileSize = 1500000 var FormSizeLimit = 4000000 function checkFileSize() { var fileSize = parseInt(document.getElementById('himg'.fileSize,10) ; if ( fileSize>maxFileSize ) { alert("File troppo grande ("+fileSize+"). max="+maxFileSize); return false; } return true; } </script> ... da usare con ... <form .... onsubmit="return checkFileSize();"> ... <input type="file" name="hing" id="himg">
ciao

Rispondi quotando