I'm uploading images to AWS S3 with the developer toolkit for node:
const aws = require('aws-sdk');
const s3Bucket = process.env.S3_BUCKET;
const s3 = new aws.S3({
signatureVersion: 'v4',
region: process.env.S3_REGION,
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
});
const s3Params = {
Bucket: s3Bucket,
Key: filename,
Expires: 60,
ContentType: filetype,
ACL: 'public-read',
};
This works but how can I make image be uploaded to a specific folder in the bucket?