August 1999
Intermediate to advanced
1488 pages
72h 53m
English
filesystemobject.GetFile(/file name/)
The GetFile() method is used to get a specified file object.
Listing 9.86 shows how you can use the GetFile() method to get the size of a file.
<html>
<body>
<script language="JScript">
<!-- Hide
function getsize()
{
var myObject, afile, size;
// Creates an instance of the FileSystemObject
myObject = new ActiveXObject("Scripting.FileSystemObject");
afile = myObject.GetFile("c:\\test.txt")
//Gets the size of the file
size = afile.Size;
// Informs user of the file size
alert("The size of the test.txt file is:" + size);
} // End Hide --> </script> Get the size for the file "test.txt" <form name="myForm"> ... |
Read now
Unlock full access