朋友,在你的电脑里找到JSCRIPT5.CHM,打开,搜索"size".

解决方案 »

  1.   

    <html>
    <head>
    <script language=javascript>
    var num = Math.round(Math.random()*12);
    alert(num);
    function getfile(){      var fso,f,s;
         fso = new ActiveXObject("Scripting.FileSystemObject");
         f = fso.GetFile(document.formname.file.value);     
         s = f.Name + " on Drive " + f.Drive + "<br>";     
         s += "文件建立的日期: " + f.DateCreated + "<br>";     
         s += "最后打开的时间: " + f.DateLastAccessed + "<br>";     
         s += "最后修改的时间: " + f.DateLastModified + "<br>";     
         s += "文件大小: "+f.size +" bytes" + "<br>";      
         s += "文件属性: "+f.attributes +"<br>";
          document.write(s);}   
    </script>
    </head>
    <body>
    <form name=formname action=filesize.htm  enctype="multipart/form-data" method="post" >
    <input name=file type=file>
    <input type="button" name="fileupb" value="送出" onclick="getfile()">
    </form>
    </body>
    </html>
      

  2.   

    <img src="a.gif" onclick="alert(this.filesize)"><input type="button" value="按钮" onclick="alert(document.filesize)">