No results for

Powered byAlgolia

S3Client.putObject(bucketName, objectKey, data)

S3Client.putObject uploads an object to a bucket.

bucketNamestringName of the bucket to upload the object to.
objectKeystringName of the uploaded object.
datastring | ArrayBufferContent of the object to upload.


import { AWSConfig, S3Client } from '';
const awsConfig = new AWSConfig(
const s3 = new S3Client(awsConfig);
const testBucketName = 'test-jslib-aws';
const testFileKey = 'bonjour.txt';
const testFile = open('./bonjour.txt', 'r');
export default function () {
// Let's upload our test file to the bucket
s3.putObject(testBucketName, testFileKey, testFile);
// And let's redownload it to verify it's correct
const obj = s3.getObject(testBucketName, testFileKey);