onComplete: Set an event handler called upon download completion.
The onComplete property is used to set an event handler to be called upon completion of the download.
The code shown below was run when this page loaded. The event in this case is to explicitly notify the user with a custom message once the download is complete. The dlmContainer and startDLM HTML elements are already defined in this page.
Click the Start Download link to begin. If you haven't installed the NetSession client, you'll be prompted to download and install it first.
Code
function completeHandler() {
alert("Your file is ready.");
}
var url = "http://client.akamai.com/install/test-objects/rand.bin";
var dlm = new DLM(DLMCID, url, null, "dlmContainer", "startDLM");
dlm.downloadPath = "prompt";
dlm.openOnComplete = false; // This is to prevent the "Do you really
// want to open this?" dialog from getting in the way of our demo.
dlm.onComplete = completeHandler;
