Determining the Results of a Download

If you are developing a web application that needs to track the results of file downloads, you can use the finishUrl parameter supported by the Download Applet to pass this information back to your application.

The finishUrl parameter needs to be set to point to a server-side script that can process query string parameters. As examples of the different ways in which the server-side scripting can be accomplished, examples for both VBSCRIPT for Microsoft Active Server Pages and Allaire Cold Fusion are given. However, in general, any scripting language and environment could be used.

Using Active Server Pages, your finishUrl could reference the following script to display the download results:

Response.Write "<H1>" & Request.QueryString("STATUS") & "</H1>"

With Cold Fusion, the same thing could be accomplished with the following script:

<CFOUTPUT>
<H1>#URL.STATUS#</H1>
</CFOUTPUT>

To see if the download was successful, simply compare the value of the STATUS variable to expected result. For a complete description of STATUS values, see the finishUrl parameter.

In addition to the STATUS variable, the DIR variable is also passed to the finishUrl script for all 'Save All' and 'Save All To' operations. The value of the DIR variable identifies the actual destination directory used to save the download the files. Your application could use this variable to create the next download page and save the user from having to select the directory again.

For more information on server-side scripting, refer to the documentation that came with your scripting tool.