The code is as follows:
Under ie, it seems that you want to change the item in the security settings [Initialize and execute ActiveX space marked as a safe execution script]
The code copy is as follows:
<html>
<head>
<script type="text/javascript">
var isIE = /msie/i.test(navigator.userAgent) && !window.opera;
function fileChange(target) {
var fileSize = 0;
if (isIE && !target.files) {
var filePath = target.value;
var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
var file = fileSystem.GetFile (filePath);
fileSize = file.Size;
} else {
fileSize = target.files[0].size;
}
alert("File byte size:"+fileSize);
var size = fileSize / 1024;
if(size>10000){
alert("Attachment cannot be greater than 10M");
}
}
</script>
</head>
<body>