javascript片段在Internet Explorer中查找文件大小, 我发现的唯一的是ActiveX对象,但遗憾的是它在IE 9中不起作用。下面提到错误。
var iefilePath = $("fileInput").val();
var ieFileName = iefilePath.slice(iefilePath.lastIndexOf("\\") + 1);
var objFSO = new ActiveXObject("Scripting.FileSystemObject");
//error SCRIPT429: Automation server can't create object
var objFile = objFSO.getFile(iefilePath);
var fileSize = objFile.size;
alert(objFile.size);