Lua Requires Chilkat v9.5.0.89+
Lua
Wasabi FTP Download
See more Wasabi Examples
Demonstrates how to download a file from a Wasabi bucket using FTP.Chilkat Lua Downloads
local chilkat = require("chilkat")
-- This example assumes the Chilkat HTTP API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
local ftp = chilkat.Ftp2.new()
-- Use the domain for the bucket you'll be managing.
ftp.hostname = "s3.s3.us-west-1.wasabisys.com"
-- Use your root account username (email address) and root account password
ftp.username = "root_account_username"
ftp.password = "root_account_password"
ftp.ssl = true
ftp.port = 990
local success = ftp:connect()
if not success then
print(ftp.last_error_text)
return
end
-- Upload a file (starfish.jpg) to the bucket named "chilkat"
local localFilePath = "qa_output/starfish.jpg"
local remoteBucketPath = "/chilkat/starfish.jpg"
success = ftp:get_file(remoteBucketPath, localFilePath)
if not success then
print(ftp.last_error_text)
return
end
print("File uploaded.")