WebFile.OnDownloaded

From Xojo Documentation

Property (As FileDownloadedDelegate )
aWebFile.OnDownloaded = newFileDownloadedDelegateValue
or
FileDownloadedDelegateValue = aWebFile.OnDownloaded

Supported for all project types and targets.

Pointer to a method which is called when a WebFile is requested.

Examples

This example creates a WebFile to download. After the browser begins the download, it calls the specified delegate method:

Dim wf As New WebFile
wf.Filename = "test.txt"
wf.ForceDownload = True
wf.Data = "DownloadMe!"
wf.OnDownloaded = AddressOf DownloadComplete

// mDownloader As WebFile is a property on the web page
// A property is used so that it does not go out of scope
// when the method ends.
mDownloader = wf
If mDownloader.Download Then
// Download started, DownloadComplete is called when it finishes
End If

DownloadComplete is a method on the web page:

Sub DownloadComplete(wf As WebFile)
mDownloader = Nil
MsgBox("Download finished.")
End Sub