Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

using multer -s3 amazon server image upload error access denied

// or use my trick like this
let acl = 'ACL'

// like this not my trick
var upload = multer({
    storage: multerS3({
        s3: s3,
        ACL: 'public-read',
        bucket: BucketName,
        key: function (req, file, cb) {
            cb(null, new Date().toISOString() + '-' + file.originalname);
        }
    })
});

// like this with my trick for by error in ts
var upload = multer({
    storage: multerS3({
        s3: s3,
        [acl]: 'public-read',
        bucket: BucketName,
        key: function (req, file, cb) {
            cb(null, new Date().toISOString() + '-' + file.originalname);
        }
    })
});
 
PREVIOUS NEXT
Tagged: #multer #amazon #server #image #upload #error #access #denied
ADD COMMENT
Topic
Name
9+1 =