I hope you can help me, I am creating a video application and I need to create a folder, inside another folder called videos that is in My Bucket, that new folder must have the user id and inside the uploaded videos.
This is my upload.js file ... where should I apply the creation of the new folder in my bucket with the user id?
aws.config.update({
secretAccessKey: 'YOUR_ACCESS_SECRET_KEY',
accessKeyId: 'YOUR_ACCESS_KEY_ID',
region: 'us-east-1'
});
const s3 = new aws.S3();
app.use(bodyParser.json());
const upload = multer({
storage: multerS3({
s3: s3,
acl: 'public-read',
bucket: 'vsvideoscl',
dirname: '/videos',
key: function (req, file, cb) {
console.log(file);
cb(null, file.originalname + Date.now()); //use Date.now() for unique file keys
}
})
});