Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v9.5.0.89+

Wasabi FTP Download

See more Wasabi Examples

Demonstrates how to download a file from a Wasabi bucket using FTP.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oFtp
LOCAL cLocalFilePath
LOCAL cRemoteBucketPath

nSuccess := 0

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

oFtp := CreateObject("Chilkat.Ftp2")

//  Use the domain for the bucket you'll be managing.
oFtp:Hostname := "s3.s3.us-west-1.wasabisys.com"

//  Use your root account username (email address) and root account password
oFtp:Username := "root_account_username"
oFtp:Password := "root_account_password"
oFtp:Ssl := 1
oFtp:Port := 990

nSuccess := oFtp:Connect()
IF (nSuccess == 0)
    ? oFtp:LastErrorText
    oFtp:destroy()
    RETURN
ENDIF

//  Upload a file (starfish.jpg) to the bucket named "chilkat"
cLocalFilePath := "qa_output/starfish.jpg"
cRemoteBucketPath := "/chilkat/starfish.jpg"
nSuccess := oFtp:GetFile(cRemoteBucketPath, cLocalFilePath)
IF (nSuccess == 0)
    ? oFtp:LastErrorText
    oFtp:destroy()
    RETURN
ENDIF

? "File uploaded."

oFtp:destroy()