React Native
React Native
Wasabi Download File
See more Wasabi Examples
Demonstrates how to download a file from a Wasabi bucket.Chilkat React Native Downloads
import { Http } from '@chilkat/react-native'
async function chilkatExample() {
// This requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const http = new Http();
// 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';
const bucketName = 'chilkat-west';
const objectName = 'seahorse.jpg';
const localFilePath = 'c:/temp/qa_output/seahorse.jpg';
try {
await http.s3DownloadFileAsync(bucketName, objectName, localFilePath);
console.log('File downloaded.');
} catch {
console.log(http.lastErrorText);
}
}