Dear Friend,
Checking a FileSize through with javascript may impose serious issues on the browsers who don't allow javascript to run. Also, javascript is using ActiveX object and nowadays in latest browsers it will ask for user permission to access ActiveX object. Sometimes it may happen that browser does not support ActiveX object or it is disabled so the code in jQuery or javascript fails.
So for if you are using ActiveX object and knows that browser will defiantly support the below script then you are through with this problem:-
<script language="javascript" type="text/javascript">
var objFSO ;
try
{
objFSO = new ActiveXObject("Scripting.FileSystemObject");
}
catch(err)
{
alert(err.message);
alert(err.number);
}
function CheckExtention(el)
{
var myel= document.getElementById(el);
var file;
var path = myel.value;
file = objFSO.getFile(path);
var size;
size = file.size ;
alert(‘File Size is : ‘ + file.size /1024 +‘ KB’);
}
</script>
I hope you understand.
Thanks