<SCRIPT language=javascript>
function index_image_valid(){
var img=new Image();
var tout;
window.clearTimeout(tout);
img.src=document.pho_up.pho_index.value;
imagewidth=img.width;
imageheigth=img.height;
fsize=img.fileSize/1024;
fsize=fsize.toFixed(1);
document.pho_up.cmd.disabled=true;
if(img.readyState!="complete")
  tout=window.setTimeout("index_image_valid()",10);
else
  {alert ("宽:"+imagewidth+"\n高:"+imageheigth+"\n大小:"+fsize+" KB");
   document.pho_up.cmd.disabled=false}
}
</script>
</head>
<form name="pho_up" method="post" enctype="multipart/form-data">
<input type="file" name="pho_index" size="20">
<input type=button name="cmd" value="测试图片大小" onclick="index_image_valid();"> 
</form>