Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 208
HOW TO: Use FileManager and Archive client-side with XFile

XFile, our client-side activeX file transfer control, comes bundled with our FileManager and Archive components for use client-side.  This expands the functionality of XFile to allow for more powerful file transfer applications which can manipulate files on the client machine.  The dlls for XFile, FileManager, and Archive are downloaded to the client via a signed cab file.

Possible uses of FileManager with XFile:

- Iterate through the contents of a client directory and automatically add files to Xfile to be uploaded
- Move or delete files after upload
- Create a new directory structure on the client before downloading

Possible uses of Archive with XFile:

- Automatically archive multiple files into a single zip file before uploading
- Automatically unzip files after download


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">

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.

Created : 12/1/2002 12:00:00 AM (last modified : 8/6/2001 6:59:00 PM)
Rate this article!