Xbase++
Xbase++
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 Xbase++ Downloads
LOCAL nSuccess
LOCAL oHttp
LOCAL cLocalFilePath
nSuccess := 0
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
oHttp := CreateObject("Chilkat.Http")
oHttp:SetRequestHeader("Host", "chilkatsoft.com")
cLocalFilePath := "/temp/hamlet.zip"
nSuccess := oHttp:Download("http://107.180.46.206:80/hamlet.zip", cLocalFilePath)
IF (nSuccess != 1)
? oHttp:LastErrorText
oHttp:destroy()
RETURN
ENDIF
? "OK!"
oHttp:destroy()