Rust
Rust
S3 Download File
See more Amazon S3 Examples
Demonstrates how to download a file from the Amazon S3 service.Chilkat Rust Downloads
// This requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = chilkat::Http::new();
http.set_aws_access_key("AWS_ACCESS_KEY");
http.set_aws_secret_key("AWS_SECRET_KEY");
http.set_aws_region("us-west-2");
http.set_aws_endpoint("s3-us-west-2.amazonaws.com");
let bucket_name = "chilkat.qa".to_string();
let object_name = "/images/sea_creatures/starfish.jpg".to_string();
let local_file_path = "qa_output/starfish.jpg".to_string();
if http.s3_download_file(&bucket_name, &object_name, &local_file_path).is_err() {
println!("{}", http.last_error_text());
} else {
println!("File downloaded.");
}