关于javascript判断文件大小
canca
2008-08-13 12:53
2
0
- <script type="text/javascript">
- function getFileSize(filePath)
- {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- alert("文件大小为:"+fso.GetFile(filePath).size);
- }
- </script>
- <body>
- <INPUT TYPE="file" NAME="file" SIZE="30" onchange="getFileSize(this.value);">
- </body>
<script type="text/javascript"> function getFileSize(filePath) { var fso = new ActiveXObject("Scripting.FileSystemObject"); alert("文件大小为:"+fso.GetFile(filePath).size); } </script> <body> <INPUT TYPE="file" NAME="file" SIZE="30" onchange="getFileSize(this.value);"> </body>
不推荐,也不多说
src,dynsrc,start,alt,controls,loop,loopdelay,hspace,vspace....
fileCreatedDate、fileModifiedDate、fileSize、fileUpdatedDate、filters...
- <script type="text/javascript">
- function getFileSize(filePath)
- {
- var image=new Image();
- image.dynsrc=filePath;
- alert(image.fileSize);
- }
- </script>
- <body>
- <INPUT TYPE="file" NAME="file" SIZE="30" onchange="getFileSize(this.value)">
- </body>
<script type="text/javascript"> function getFileSize(filePath) { var image=new Image(); image.dynsrc=filePath; alert(image.fileSize); } </script> <body> <INPUT TYPE="file" NAME="file" SIZE="30" onchange="getFileSize(this.value)"> </body>
推荐,没的说
发表评论