|
October 19, 2000 Constructing A File Object Tips: October 2000
Yehuda Shiran, Ph.D.
|
|
One of the less-covered subjects in JavaScript is the File IO. Usually, a JavaScript script operates on the HTML code that is already loaded onto the page, and it does not need to get more information from an external file. Like many other applications, the File IO is also based on the ActiveX technology. You create an ActiveX File object by calling ActiveXObject() with a single argument, Scripting.FileSystemObject:
You can create a File object by using the ActiveX's
The File object supports various properties and methods. The following code shows how to use the
We don't show a live demo here, as for security reasons you cannot access the client file system from a server-based file. Learn more about ActiveX controls in Column 55, OLE Automation in JavaScript.
People who read this tip also read these tips: Look for similar tips by subject: |