Hi All,I am using ASP.NET to build a system.I want to implement a function, that the app can get the file's size before user uploads it through the file upload control. I know that due to the security policy, JavaScript will be blocked. But I found this URL:http://www.uploadify.com/demo/And it worked well in my Firefox, here is an official sample which applying UPLOADIFY in ASP.NET, but I actually I just would like to know the file's size, no need complexity.
If anyone can give me some suggestion, I will be really grateful.At the moment, I want to ascertain that is the function (getting size of file) done by JQurey or Flash.Thanks.
If anyone can give me some suggestion, I will be really grateful.At the moment, I want to ascertain that is the function (getting size of file) done by JQurey or Flash.Thanks.
<script>
function getSize()
{
var myFSO = new ActiveXObject("Scripting.FileSystemObject");
var filepath = document.upload.file.value;
var thefile = myFSO.getFile(filepath);
var size = thefile.size;
alert(size + " bytes");
}
</script>
</head>
<body>
<form name="upload">
<input type="file" name="file">
<input type="button" value="Size?" onClick="getSize();">
</form>
</body>
</html>But I got an error 'Automation对象不能创建'.I installed scrrun.dll and registered it on both server and client computer.Still got the same error. Anyone can help me? Thanks a lot.
due to the security policy!
1. find scrrun.dll under the system dir, if successful, you can jump to step 3, or else, continue step 2.
2. find scrrun.dl_ under i386 dir in the windows installment disk, decompress it, you will find the dll file scrrun.dll, then copy it to c:window\system32
3. run statement "regsvr32 scrrun.dll"And if you want to shutdown FSO, just run "regsvr32 /u scrrun.dll".