jeanbmar / payload-s3-upload

Send Payload CMS uploads to Amazon S3
MIT License
56 stars 9 forks source link

Bucket factory #18

Open chladog opened 1 year ago

chladog commented 1 year ago

This PR brings a feature of bucket property factory similar to current prefix factory allowing for dynamic bucket resolution based on incoming data doc e.g. mimeType:

        s3: {       
              bucket: ({ doc }) => doc.mimeType.startsWith('image') ? 'images-source' : 'public',
              ...
        }

Useful for when you need to organize files to different buckets based on mimeType, filename or size.