| Minimizing User Interaction |
Use of the FileDownload applet will cause various dialogs and prompts to be displayed to the user. The topics below describe how these different user interactions can be minimized:
Applet Security Dialog
Download Confirmation Dialog
Preselecting the Download Directory
Replacement of existing files
Because the Download Applet requires access to the user's local hard drive, the first thing it does is request the permissions needed. This causes the web browser to display its security dialog asking the user to grant the requested permissions. This prompting is forced by the web browser as part of its security and will happen each time the applet is loaded, typically once per browser session. The only way to prevent this dialog from displaying in future browser sessions is for the user to check the 'Always trust content from...' box under Internet Explorer or the 'Remember this decision' box under Netscape Navigator.
To prevent files from automatically being downloaded to a user's hard disk without their approval, the Download Applet will always prompt the user for confirmation and display the list of files being downloaded. While there is no way to eliminate this prompt the first time, you can give the user the option to skip the dialog during future downloads by setting the noConfirm parameter to true. This will cause a "Don't ask for confirmation" checkbox to be included in the dialog.
It is also possible to simplify the Download Confirmation Dialog by limiting the options available to the user. By default, the user has three options: 'Save All', 'Save All To', and 'Save As'. The 'Save All' option will automatically save the files in the location specified by the directory parameter. The 'Save All To' option will allow the user to select a destination directory to save all the files to. Finally, the 'Save As' option will prompt the user one file at a time for the save location.
You can eliminate one or two, but not all, of these options by specifying combinations of the following parameters:
For example, if you only wanted to allow the user to save the files in the location specified by the directory parameter, use the following download file:
<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:\app\">
<PARAM NAME="url1" VALUE="data1.bin">
<PARAM NAME="url2" VALUE="data2.bin">
<PARAM NAME="noSaveAllTo">
<PARAM NAME="noSaveAs">
</APPLET>
Even with the other two options unavailable, the user will still be prompted to confirm the download, and have the option to cancel.
If you do not set the directory parameter, the 'Save All' option behaves just like 'Save All To' requiring the user to select the download directory each time. You can eliminate this step by saving the contents of the DIR parameter passed to your finishUrl script and using that value to set the directory parameter the next time. Refer to to the Image Cart sample application for an example of this technique.
If the file being downloaded already exists in the download directory, the FileDownload applet will by default prompt the user giving them the option to overwrite the file. To eliminate this prompt, set the autoSync parameter to a value other than PROMPT.
For example, if you want to always overwrite existing files without prompting the user include the following parameter:
<PARAM NAME="autoSync" VALUE="ALWAYS">