File.Type

JScript3.0+Syntax

							file.Type

Description

The Type property is used to get information pertaining to the type of file.

Example

Listing 9.65 shows an example of how the Type property is used to get the type return the type of file that myTest.txt is.

Listing 9.65 Example of the Type Property
<html>
<body>

<script language="JScript">
<!-- Hide
function get()
{
  var myObject, f;
  // Create an instance of the FileSystemObject
  myObject = new ActiveXObject("Scripting.FileSystemObject");

  // Gets the file myTest.txt
  f = myObject.GetFile("c:\\tmp\\myTest.txt");
  alert("The name type is: " + f.Type);
}

//-->
</script>

<form name="myForm">
<input type="Button" value="Get File Type" onClick='get()'>
</form>

</body>
</html>
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.