Builds a non-signed, canonical URI for an S3 (or S3-compatible) object. No network call is made. style may be virtualhost (default) or path; secure controls the https/http scheme; host overrides the endpoint (e.g. for Cloudflare R2 or MinIO).
s3GenerateURI(bucket [, object, style, secure, host])
→ returns string
virtualhostvirtualhostpathtrueVirtual-host style against the default endpoint.
uri = s3GenerateURI("my-bucket", "reports/q3.pdf");
Expected Result: https://my-bucket.s3.amazonaws.com/reports/q3.pdf
Useful for providers that do not serve bucket subdomains.
uri = s3GenerateURI("my-bucket", "reports/q3.pdf", "path", true, "minio.example.com");
Expected Result: https://minio.example.com/my-bucket/reports/q3.pdf
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.