File Download Basics

The usual method for allowing a file to be downloaded from a web server is to provide a direct link to the file. When the user selects the link, the file addressed by the link's URL is retrieved and processed by the web browser.

Instead of linking directly to the file, an intermediary HTML page or script containing the AppletFile Download Applet can be used to provide better control over the download process. In this situation, the web browser first retrieves the script containing the Download Applet and then the Applet begins downloading one or more files.

For example, if you had the following download link to a spreadsheet template:

<A HREF="template.xls">

You could change the link to use the AppletFile Download Applet as follows:

<A HREF="download.html">

Where download.html would contain the following:

<APPLET CODE=FileDownload.class ARCHIVE=FileDownload.jar NAME=FileDownload 
        CODEBASE="/AppletFile/classes" WIDTH=2 HEIGHT=2 MAYSCRIPT>
 <PARAM NAME="cabbase" VALUE="/AppletFile/classes/FileDownloadIE3.cab">
 <PARAM NAME="cabinets" VALUE="/AppletFile/classes/FileDownload.cab">
 <PARAM NAME="directory" VALUE="C:\My Documents">
 <PARAM NAME="url1" VALUE="template.xls">
 <PARAM NAME="file1" VALUE="template.xls">
</APPLET>

By using the AppletFile Download Applet, the process of downloading the spreadsheet template is simplified by allowing the downloaded file to be saved in the "C:\My Documents" directory automatically with as little user interaction as possible.