You received SoftArtisans FileManager free with your purchase of XFile. SoftArtisans FileManager answers all of your file management needs in a single, easy-to-use control.
SoftArtisans FileManager is 100% script compatible with Microsoft's Scripting.FileSystemObject, while offering numerous advantages:
The following example demonstrates deleting a file using SoftArtisans FileManager.
Create an HTML script, containing the following lines.
<object classid="clsid:E7B62F4E-82F4-11D2-BD41-00105A0A7E89"
codebase="localhost/SAXFileSamples/saxfile.cab" id="FileMgr">
</object>
<script language="vbs">
Sub DeleteFile_onClick()
FileMgr.DeleteFile "c:\x.txt"
End Sub
</script>
<input Type=Button Name="DeleteFile" value="Delete File">
<object>
tag creates an instance of SoftArtisans FileManager.
Classid
specifies FileManager's unique class id, clsid:E7B62F4E-82F4-11D2-BD41-00105A0A7E89.
Codebase
specifies the location of saxfile.cab, which contains SAFilMgr.dll (FileManager's dll).
Id
assigns a name to the created instance of SoftArtisans FileManager.
DeleteFile_onClick()
executes when the user clicks the "Delete File" button.
DeleteFile
method deletes the specified file. When setting a file to delete,
include the the complete file path and name. In addition to the file name, DeleteFile
takes the optional parameter Force. If Force is set to True, FileManager will delete a
file even if it is marked "Read only." By default, Force is set to False.
<input>
tag creates a "Delete File" button. When the user
clicks this button, the DeleteFile_OnClick()
procedure will execute.
Exercise 16 demonstrates creating an instance of SoftArtisans FileManager on the
client, using the <object>
tag. You can also use FileManager on the server,
within an ASP script.
To create an instance of FileManager within an ASP script, use Server.CreateObject, as follows.
Set objFileManager = Server.CreateObject("SoftArtisans.FileManager")