<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <title> new document </title> <meta name="generator" content="editplus"> <meta name="author" content=""> <meta name="keywords" content=""> <meta name="description" content=""> </head> <script type="text/javascript"> function getFileSize(filePath) { var image=new Image(); image.dynsrc=filePath; alert(image.fileSize); } </script> <body> <INPUT TYPE="file" NAME="file" SIZE="30" οnchange="getFileSize(this)"> </body> <script type="text/javascript"> function getFileSize(fileObj) { var image=new Image(); image.dynsrc=fileObj.value; var size = image.fileSize || fileObj.files[0].fileSize; if(size > 100000){ alert(size); } } </script> <body> <INPUT TYPE="file" NAME="file" SIZE="30" οnchange="getFileSize(this.value)"> </body> </html>