How to rename files when exporting them to cloud storage?
Set the /s3/store Robot’s path parameter to choose the exported object key. This changes the destination name, not the input file or its metadata. Other export Robots have their own path rules; check the destination Robot’s documentation.
This Template adds renamed- to the file’s URL-safe name and places it under a unique prefix. It uses the private-bucket configuration from the S3 setup guide:
{
"steps": {
":original": {
"robot": "/upload/handle"
},
"exported": {
"robot": "/s3/store",
"use": ":original",
"credentials": "YOUR_S3_CREDENTIALS",
"acl": "bucket-default",
"path": "uploads/${unique_prefix}/renamed-${file.url_name}"
}
}
}
Replace YOUR_S3_CREDENTIALS with a saved Template Credential whose permissions cover the destination prefix. acl: "bucket-default" omits the object ACL; bucket and IAM policies still control access. See protecting credentials and instructions before exposing this flow to a browser.
Variables such as ${file.url_name} are resolved during processing. A path using file metadata or a unique prefix is not a complete object key that your application can necessarily know before upload. Read the completed Assembly’s export result rather than inferring a public download URL.
