Lua Requires Chilkat v9.5.0.89+
Lua
Wasabi FTP Upload
See more Wasabi Examples
Demonstrates how to upload a file to Wasabi 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_data/jpg/starfish.jpg"
local remoteBucketPath = "/chilkat/starfish.jpg"
success = ftp:put_file(localFilePath, remoteBucketPath)
if not success then
print(ftp.last_error_text)
return
end
print("File uploaded.")