[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>
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>