This topic highlights basic concepts which you need to grasp to start using File Downloader.
To integrate File Downloader with your website, you always need to do the following steps:
FileDownloader7.cab
, FileDownloader7_x64.cab
, and FileDownloader7.jar
to your Web server where the website is running.iuembed.js
script and add File Downloader to a Web page where you want to use this control.File Downloader is not a standalone application. It can be interpreted as a "browser add-on" that should be embedded into a page. Here is how to do it.
First, you need to install File Downloader SDK. This SDK contains documentation, demo applications, and redistributable files:
FileDownloader7.cab
FileDownloader7_x64.cab
FileDownloader7.jar
iuembed.js
File Downloader SDK can be downloaded from the following location: http://www.aurigma.com/downloads/file-downloader. Here the SDK is available in the following packages:
FileDownloader.exe
, Windows-only installerFileDownloaderNoSetup.zip
, ZIP archiveIf you downloaded the Windows-only installer, just run the FileDownloader.exe
file and follow the wizard steps. During one of these steps you specify the folder where to install all File Downloader SDK files. Typically this is C:\Program Files\Aurigma\File Downloader 7.0.9\
; you will find all necessary files there.
Use
for non-Windows platforms.
Unpack this archive into any folder on your computer to get SDK files.FileDownloaderNoSetup.zip
After installation, add the control to your Web page. As File Downloader is provided along with the special helper JavaScript file called iuembed.js
, and this script functions are used to invoke and configure the control, do the following.
FileDownloader7.cab
FileDownloader7_x64.cab
FileDownloader7.jar
iuembed.js
iuembed.js
with the required Web page by
inserting the following line in the beginning of this page:
<script type="text/javascript" src="iuembed.js"></script>
<script language="javascript"> // Create an instance of FileDownloaderWriter var fd = new FileDownloaderWriter("FileDownloader", 122, 44); // A path to the CAB file (including the file name) fd.activeXControlCodeBase = "FileDownloader7.cab"; // A path to the x64 CAB file (including the file name) fd.activeXControlCodeBase64 = "FileDownloader7_x64.cab"; // Version of the CAB file fd.activeXControlVersion = "7,0,10,0"; // A path to the JAR file fd.javaAppletCodeBase = "./"; // A file name of the JAR file fd.javaAppletJarFileName = "FileDownloader7.jar"; // Version of the JAR file fd.javaAppletVersion = "7.0.10.0"; // ... Initialize parameters as described in the 'Configuring File Downloader' // section below ... // As soon as you call this method, all necessary HTML code is inserted into // the page at the current position. Alternatively, you can get the string with // appropriate HTML code using the getHtml method, and write it to the // necessary position manually (maybe with some modifications). fd.writeHtml(); </script>
If you encounter problems loading File Downloader, make sure that:
If you prefer not to use Java or ActiveX version of File Downloader, you should disable it using the corresponding property (FileDownloaderWriter.activeXControlEnabled or FileDownloaderWriter.javaAppletEnabled). The following sample disables the Java version of File Downloader, as a result non-Internet Explorer browsers become unsupported by File Downloader:
<script language="javascript"> // Create an instance of FileDownloaderWriter var fd = new FileDownloaderWriter("FileDownloader", 122, 44); // A path to the CAB file (including the file name) fd.activeXControlCodeBase = "FileDownloader7.cab"; // A path to the x64 CAB file (including the file name) fd.activeXControlCodeBase64 = "FileDownloader7_x64.cab"; // Version of the CAB file fd.activeXControlVersion = "7,0,10,0"; // Disable Java version of File Downloader fd.javaAppletEnabled = false; //...other parameters... fd.writeHtml(); </script>
The next step you need to complete is to prepare a list of downloadable files. The file list is a
plain text file. Each entry in this list corresponds to one file and takes up exactly one line. The
entry consists of four fields separated by pipes (|
). These fields represent:
0
.The order of fields in the entries is important.
Here is a sample file list.
image/jpeg | 174546 | apples.jpg | http://localhost/Fruits/apples.jpg image/jpeg | 134257 | apricots.jpg | http://localhost/Fruits/apricots.jpg image/png | 545675 | avocados.png | http://localhost/Fruits/avocado.png
The file list can be a simple static file or can be generated by a server script on request. The latter approach is used in our samples (see the Samples topic). If the static file is sufficient for your needs, put it somewhere on your Web server.
File Downloader has a number of parameters, but some of them are essential for the proper work of the control, and some are simply intended for customization. In this section we will breifly overview the most important parameters.
The most important parameters are:
To specify these parameters add the following lines in the JavaScript block listed above. Note that the lines should be added before the fd.writeHtml() instruction.
<script language="javascript"> var fd = new FileDownloaderWriter("FileDownloader", 122, 44); //...other parameters... fd.addParam("FileList", "http://localhost/filedownloader/filelist.txt"); fd.addParam("LicenseKey", "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX"); fd.addParam("ButtonDownloadText", "Download Files"); //...other parameters... fd.writeHtml(); </script>
You can learn more about these and other properties in the FileDownloader Class Members and Helper Script Reference (iuembed.js) topics.
Now you can test the Web page with File Downloader.
File Downloader is distributed with a number of demo applications which can be used as code samples. You can find them in the installation folder of File Downloader.
Samples are available for the following platforms:
Below you will find a number of useful links related to File Downloader.
Online demo of File Downloader. You can use it if you want to see File Downloader in action without installing demo applications on your machine.
Information on how to deploy File Downloader on the production server.
Information on how to use license keys obtained upon purchase to remove limitations of the evaluation version.
List of all FileDownloader class members. It will be useful when you start configuring File Downloader parameters.
Reference and programmer's guide to the helper iuembed.js
script. It is highly recommended to familiarize yourself with
this topic before you start editing the File Downloader-related client-side code.
Root topic for the File Downloader manual, which contains a number of articles demonstrating how to use File Downloader for different tasks.