Sample code for 30+ languages & platforms
Xojo Plugin

HTTP Download with Progress Event Callbacks

See more HTTP Examples

Downloads a file via HTTP or HTTPS and uses event callbacks to monitor progress.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Class MyHttp
    Inherits Chilkat.Http

    Sub AbortCheck(ByRef abort As Boolean)
        
    End Sub

    Sub PercentDone(percentDone As Int32, ByRef abort As Boolean)
        System.DebugLog("Percent Done: " + Str(percentDone))
        // Explicitly abort at 25% or greater.
        // Remove this to allow for the HTTP download to run to completion.
        If (percentDone > 25) Then
            abort = True
        End If
    End Sub

    Sub ProgressInfo(name As String, value As String)
        System.DebugLog(name + ": " + value)
    End Sub

End Class

Dim success As Boolean
success = False

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

Dim http As New MyHttp

// Set a heartbeat in milliseconds 
http.HeartbeatMs = 200

// Download a file...
Dim localFilePath As String
localFilePath = "qa_output/Python-3.4.4.tar.xz"
success = http.Download("https://www.python.org/ftp/python/3.4.4/Python-3.4.4.tar.xz",localFilePath)
If (success = False) Then
    System.DebugLog(http.LastErrorText)
    Return
End If

System.DebugLog("OK!")