[javascript] 用js得到文件大小

 1<script type="text/javascript">  
 2function getFileSize(filePath)  
 3{  
 4    var image=new Image();  
 5    image.dynsrc=filePath;  
 6    alert(image.fileSize);  
 7 }
  
 8 </script>  
 9 <body>  
10 <INPUT TYPE="file" NAME="file" SIZE="30" onchange="getFileSize(this.value)">  
11 </body> 
posted on 2008-08-12 17:18  JIN Weijie  阅读(739)  评论(0编辑  收藏  举报