Sample code for 30+ languages & platforms
Dart

Wasabi Download File

See more Wasabi Examples

Demonstrates how to download a file from a Wasabi bucket.

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

void main() {
  // This requires the Chilkat API to have been previously unlocked.
  // See Global Unlock Sample for sample code.

  final http = CkHttp();

  // Insert your access key here:
  http.awsAccessKey = 'access-key';

  // Insert your secret key here:
  http.awsSecretKey = 'secret-key';

  // Use the endpoint matching the bucket's region.
  http.awsEndpoint = 's3.us-west-1.wasabisys.com';

  final bucketName = 'chilkat-west';
  final objectName = 'seahorse.jpg';
  final localFilePath = 'c:/temp/qa_output/seahorse.jpg';

  try {
    http.s3DownloadFile(bucketName, objectName, localFilePath);
    print('File downloaded.');
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
  }
}