Dart Requires Chilkat v9.5.0.89+
Dart
Wasabi FTP Download
See more Wasabi Examples
Demonstrates how to download a file from a Wasabi bucket using FTP.Chilkat Dart Downloads
import 'package:chilkat/chilkat.dart';
void main() {
// This example assumes the Chilkat HTTP API to have been previously unlocked.
// See Global Unlock Sample for sample code.
final ftp = CkFtp2();
// 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;
try {
ftp.connect();
} on ChilkatException catch (e) {
print(e.lastErrorText);
return;
}
// Upload a file (starfish.jpg) to the bucket named "chilkat"
final localFilePath = 'qa_output/starfish.jpg';
final remoteBucketPath = '/chilkat/starfish.jpg';
try {
ftp.getFile(remoteBucketPath, localFilePath);
} on ChilkatException catch (e) {
print(e.lastErrorText);
return;
}
print('File uploaded.');
}