React Native Requires Chilkat v9.5.0.89+
React Native
Wasabi FTP Download
See more Wasabi Examples
Demonstrates how to download a file from a Wasabi bucket using FTP.Chilkat React Native Downloads
import { Ftp2 } from '@chilkat/react-native'
async function chilkatExample() {
// This example assumes the Chilkat HTTP API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const ftp = new Ftp2();
// 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 {
await ftp.connectAsync();
} catch {
console.log(ftp.lastErrorText);
return;
}
// Upload a file (starfish.jpg) to the bucket named "chilkat"
const localFilePath = 'qa_output/starfish.jpg';
const remoteBucketPath = '/chilkat/starfish.jpg';
try {
await ftp.getFileAsync(remoteBucketPath, localFilePath);
} catch {
console.log(ftp.lastErrorText);
return;
}
console.log('File uploaded.');
}