Sample code for 30+ languages & platforms
Dart Requires Chilkat v9.5.0.89+

Wasabi FTP Upload

See more Wasabi Examples

Demonstrates how to upload a file to Wasabi using FTP.

Chilkat Dart Downloads

Dart
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_data/jpg/starfish.jpg';
  final remoteBucketPath = '/chilkat/starfish.jpg';
  try {
    ftp.putFile(localFilePath, remoteBucketPath);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  print('File uploaded.');
}