anacronw / multer-s3

multer storage engine for amazon s3
MIT License
660 stars 190 forks source link

Upgrading to V3 - Bucket name shouldn't contain '/' #207

Open nawlbergs opened 1 year ago

nawlbergs commented 1 year ago

Updating our app the the AWS v3. After doing so..

// our bucket is uploads.site.com.. and we could dump the upload in a directory like this...
multerS3({
    s3: s3,
    bucket: function (req, file, cb) {
      cb(null, `uploads.site.com/${someDynamicDir}/images`)
    },
    ...

... now we get Bucket name shouldn't contain '/' errors.

How do you properly define sub directories in multer v3?

Ganuzaz commented 1 year ago
// our bucket is uploads.site.com.. and we could dump the upload in a directory like this...
multerS3({
    s3: s3,
    bucket : 'uploads.site.com/',
    key: function (req, file, cb) {
      cb(null, `${someDynamicDir}/images/${file.originalname}`)
    },

try this