There are two ways to instantiate FileManager or Archive client-side:
1) You can use an html <object> tag. The user
must, at least once, hit a page with an <object> tag for any one of
the controls bundled with XFile. The first time this object
tag is encountered, the user will be prompted to download the active-X
object. A cab file will then be downloaded, and all of the included dlls
will be registered on the client machine.
2) Once the dlls have been registered on the client
machine, any of the objects can be instantiated within a client-side script, by using the CreateObject command. So, for example, you could instantiate XFile with an object tag (causing the cab file to be installed), and then instantiate FileManager or Archive within a script with "CreateObject".
Here is how you create a client-side instance of the FileManager object, using HTML's
<object> tag: <object classid="clsid:E7B62F4E-82F4-11D2-BD41-00105A0A7E89"
codebase="localhost/SAXFileSamples/saxfile.cab" id="objFileManager">
</object>
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.
Here is how you create a client-side instance of the Archive
object, using the <object>
tag:
<Object
Classid="clsid:D3400FEE-041F-11D3-B1C5-00A0C9B4587A"
Codebase="localhost/SAXFileSamples/saxfile.cab"
ID="objArchive"></Object>
After you have instantiated the control with the object tag, you can
refer to the object by its ID in your client-side scripts.
Note: If you have upgraded your version of any of the
clientside controls, and you want to make sure that remote clients' download the
new cab, you should add the version number to the codebase parameter of the object tag.
See the Xfile documentation under "Installation Instructions/Upgrading SoftArtisans XFile" for instructions.
Once the cab has been downloaded, and the dlls have been registered on
the client machine, it is possible to instantiate FileManager and Archive
client-side within a script using "CreateObject", without the necessity of
an object tag.
Here is the syntax:
set objFileManager = CreateObject("SoftArtisans.FileManager")
The attached sample uses FileManager client-side to
filter all the text files from the user's "c:\ "root directory and
add them to XFile to be uploaded to the server. |