Sample code for 30+ languages & platforms
B4X

HTTP Download from URL with IP Address and Port

See more HTTP Examples

Downloads a file from a URL using an IP address and port.

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

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

Dim http As ChilkatHttp
http.Initialize("http")

http.SetRequestHeader("Host", "chilkatsoft.com")

Dim localFilePath As String = "/temp/hamlet.zip"
success = http.Download("http://107.180.46.206:80/hamlet.zip", localFilePath)
If success <> True Then
    Log(http.LastErrorText)
    Return
End If


Log("OK!")