| //One important thing is that ActiveX component must exists on client side where fileupload is running
< html>
< head>
< title>Check the Size of a File -- Javascript< /title>
< script language="JavaScript">
function GetSizeFile()
{
var objSize = new ActiveXObject("Scripting.FileSystemObject");
var strFileName = objSize.getFile(document.frmFileUpload.strFile.value);
var SizeOfFile = strFileName.size;
alert(SizeOfFile + " bytes");
}
< /script>
< /head>
< body>
< form name="frmUploadFile">
< input type="file" name="strFile">
< input type="button" name="btnSize" value="Show file size" onClick="GetSizeFile();">
< /form>
< /body>
< /html> | | |