Rust Requires Chilkat v9.5.0.89+
Rust
Wasabi FTP Upload
See more Wasabi Examples
Demonstrates how to upload a file to Wasabi using FTP.Chilkat Rust Downloads
// This example assumes the Chilkat HTTP API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let ftp = chilkat::Ftp2::new();
// Use the domain for the bucket you'll be managing.
ftp.set_hostname("s3.s3.us-west-1.wasabisys.com");
// Use your root account username (email address) and root account password
ftp.set_username("root_account_username");
ftp.set_password("root_account_password");
ftp.set_ssl(true);
ftp.set_port(990);
if ftp.connect().is_err() {
println!("{}", ftp.last_error_text());
return;
}
// Upload a file (starfish.jpg) to the bucket named "chilkat"
let local_file_path = "qa_data/jpg/starfish.jpg".to_string();
let remote_bucket_path = "/chilkat/starfish.jpg".to_string();
if ftp.put_file(&local_file_path, &remote_bucket_path).is_err() {
println!("{}", ftp.last_error_text());
return;
}
println!("File uploaded.");