August 1999
Intermediate to advanced
1488 pages
72h 53m
English
file.Size
The Size property returns the size of the specified file.
In Listing 9.64, the Size property is used to get the filesize.
<html>
<BODY>
<script language="JScript">
<!-- Hide
function get()
{
var myObject, f;
// Create an instance of the FileSystemObject
myObject = new ActiveXObject("Scripting.FileSystemObject");
f = myObject.GetFile("c:\\tmp\\myTest.txt");
alert("The file size is: " + f.Size);
}
//-->
</script>
<form name="myForm">
type=value=<input type="Button" value="Get File Size" onClick='get()'>
</form>
</body>
</html>
|
Read now
Unlock full access