Optional
acl?: ObjectCannedACLWhich ACL to use on the uploaded objects. Default is "private" (urls will be signed so that the files can be reached from the frontend).
Valid values are "authenticated-read", "aws-exec-read", "bucket-owner-full-control", "bucket-owner-read", "private", "public-read", "public-read-write".
Optional
aws?: { AWS configuration
Optional
accessAWS access key, defaults to process.env.AWS_ACCESS_KEY_ID.
Optional
bucket?: stringAWS bucket, defaults to process.env.AWS_S3_BUCKET
Optional
endpoint?: stringAWS endpoint, defaults to process.env.AWS_S3_ENDPOINT
Optional
region?: stringAWS region, defaults to process.env.AWS_DEFAULT_REGION.
Optional
secretAWS secret, defaults to process.env.AWS_ACCESS_KEY_SECRET.
Optional
deleteEither if old files should be deleted when updating or deleting a record.
Name of the field that you want to use as a file-picker on the frontend
Optional
objectThis function allows customizing the object key that will be used in S3 without interfering with what is stored in the database.
objectKeyFromRecord: {
extraDependencies: ['firstname', 'lastname'],
mappingFunction: (record, context) => {
return `avatars/${record.firstname}-${record.lastname}.png`;
}
};
Optional
extraOptional
read'url' (the default) will cause urls to be transmitted to the frontend. You final users will download the file from S3.
'proxy' will cause files to be routed by the agent. Use this option only if you are dealing with small files and are behind an entreprise proxy which forbids direct access to S3.
Optional
storeThis function allows customizing the string that will be saved in the database. If the objectKeyFromRecord option is not set, the output of that function will also be used as the object key in S3.
Note that the recordId parameter will not be provided when records are created.
Defaults to '
@example
storeAt: (recordId, originalFilename, context) => {
return `${context.collection.name}/${recordId ?? 'new-record'}/${originalFilename}`;
}
Configuration for the AWS S3 addon of Forest Admin.
It can be included in the global agent configuration under the "s3" key and overriden for specific fields by using the "config" property on
AmazonS3File
.