Sample code for 30+ languages & platforms
Rust

Example: Http.S3_DownloadBd method

See more Amazon S3 Examples

Demonstrates the S3_DownloadBd method.

Chilkat Rust Downloads

Rust

// 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();

let bd = chilkat::BinData::new();
if http.s3_download_bd(&bucket_name, &object_name, &bd).is_err() {
    println!("{}", http.last_error_text());
    return;
}

println!("Downloaded {} bytes", bd.num_bytes());