<html>
 <head>
  <script language="javascript">
   function getSize() {
    var file = document.getElementById("upload").value;
    alert(file);
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    var f = fso.GetFile(file);
    alert( '大小: '+f.Size+ 'bytes ');
   }
  </script>
 </head>
 <body>
  <input id = "upload" type="file" onChange="getSize()"></input>
 </body>
</html>

posted on 2013-12-31 12:18  泥鳅桑  阅读(379)  评论(1编辑  收藏  举报