<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>
转载于:https://www.cnblogs.com/beyonce5888296/p/3499115.html