Title: Let users receive files via online download manager
Question: This article describes how to use the Clever Internet DownLoader ActiveX component, available from the Internet, in order integrate it into the web to send physically multiple files to the user local hard disk.
Answer:
For your convenience we provide the following downloads:
HTML page sample with the Java Script - clComDownLoader_js.htm
HTML page sample with the VB Script - clComDownLoader_vbs.htm
A sample content of the information file - clDownLoader.inf
Demo version of the Clever Internet DownLoader ActiveX component - clDownLoader.cab
Many web masters provide their users with the ability to download the web resources they publish with more control than offerred by standard web browsers such as Microsoft Internet Explorer, Netscape Navigator, Mozilla, Opera or others. This may be a progress indication, resuming features, more detailed resource information or some animation during the downloading process. In addition they do not want users to get and install a special download managers for this issue.
The best solution is to use ActiveX control and a special web page adapted to download, install and use it. The actual process of downloading is hidden from the user, while in progress.
The following code shows how to make the HTML tag which gets the latest downloader version from the server and sets up its properties to their default values.
ActiveX control failed to load! -- Please check browser security settings.
If you whish to distribute DownLoader ActiveX control via the Internet, you should pack it as a signed Cabinet (CAB) file. The Digital Signature can be purchased from Verisign or from THAWTE.
The CAB file contains a compressed version of the control plus information about how your control is to be installed, for example, which DLLs need to be installed along with the OCX.
You have to publish both the clComDownLoader_js.htm (clComDownLoader_vbs.htm) and the clDownLoader.cab files on your web server in order to make it work properly.
In case of publishing the clDownLoader.cab on your web server you have to modify the clDownLoader.cab URL path to its correct value within the "codebase" attribute of the "object" tag in the clComDownLoader_js.htm (clComDownLoader_vbs.htm) file.
To provide the information about how the control is to be installed, or whether or not the user's Downloader version is out-of-date and the latest version needs to be downloaded from the server or any other information, the CAB file should contain an information file inside.
A sample of the contents of such an info file is shown below in the following example:
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
clDownLoader.dll=clDownLoader.dll
[clDownLoader.dll]
file-win32-x86=thiscab
clsid={A49A2CA2-E0EF-4d9d-BAF4-4901A8F92B20}
FileVersion=2,5,0,36
RegisterServer=yes
The source code of the HTML page with Downloader can be found in both the clComDownLoader_js.htm and clComDownLoader_vbs.htm files for Java Script and VB Script versions correspondingly.
Both the js and the vbs demo codes contain a simple HTML page which uses the DownLoader control for downloading World Wide Web resources, getting resource information and displaying the preview of the resource being downloaded.
To learn more about packaging and signing cab files and automatic version updating please refer to "Packaging ActiveX Controls" article available in the MSDN Library and Microsoft online-resource - http://msdn.microsoft.com.
Please write us at info@clevercomponents.com
With best regards,
Sergey S
Clever Components team.
www.clevercomponents.com