FileRelay
Documentation
Try for Free

Cloudflare R2

Archive SAP documents to Cloudflare R2 with zero egress fees. S3-compatible API with native authentication support.

Use Cases

  • Zero-egress document storage
  • Cost-optimized SAP document archival
  • S3-compatible storage without AWS dependency

Archive SAP documents to Cloudflare R2. R2 provides S3-compatible object storage with zero egress fees, making it an excellent choice for SAP document archival where documents are frequently downloaded, shared, or accessed by downstream systems.

Setup

  1. Log in to the Cloudflare Dashboard
  2. Note your Account ID from the right sidebar on the account overview page
  3. Navigate to R2 Object Storage in the left sidebar and click Create bucket
  4. Name your bucket (e.g. sap-documents) and optionally set a location hint
  5. Go to R2 Object Storage > Manage R2 API Tokens and click Create API token
  6. Set the permissions to Object Read & Write and scope it to your bucket
  7. Copy the Access Key ID and Secret Access Key (the secret is only shown once)
  8. In FileRelay, add a Cloudflare R2 destination with the Account ID, bucket name, Access Key, and Secret Key

REPLACE: Screenshot of the Cloudflare R2 connector configuration form in FileRelay

How It Works

FileRelay connects to R2 using the S3-compatible API. The endpoint is automatically constructed from your account ID:

https://{account_id}.r2.cloudflarestorage.com

Documents are uploaded as objects with the configured prefix and automatic subfolders. R2 handles the storage with automatic data placement close to where requests originate.

Path Structure

Documents are stored with the following key pattern:

{prefix}/{subfolder}/{doc_id}.{ext}
  • prefix — configured base path (e.g. sap-documents/)
  • subfolder — automatic subfolder based on routing rules
  • doc_id — the SAP document ID
  • ext — file extension based on MIME type

Example: sap-documents/2026-04/4500012345.pdf

API Token Permissions

When creating the R2 API token, assign the following:

Permission Scope Purpose
Object Read & Write Specific bucket Upload and verify objects

For least-privilege access, scope the token to the specific bucket used by FileRelay rather than granting access to all buckets.

Cost Comparison

R2's zero-egress pricing model provides significant savings when documents are accessed frequently:

Feature Cloudflare R2 Amazon S3 (Standard)
Egress fees $0 $0.09/GB
Storage $0.015/GB/month $0.023/GB/month
Class A ops (writes) $4.50/million $5.00/million
Class B ops (reads) $0.36/million $0.40/million
S3 API compatibility Yes Native

R2 is particularly cost-effective when downstream systems (reporting tools, portals, partner access) frequently retrieve archived SAP documents.

Tips

  • Bucket location hints — R2 automatically places data close to where it is accessed. You can optionally set a location hint (e.g. enam for Eastern North America, weur for Western Europe) when creating the bucket to influence initial placement.
  • Custom domains — Attach a custom domain to your R2 bucket for branded or public access to stored documents. Configure this under the bucket's Settings > Custom Domains.
  • Lifecycle rules — R2 supports object lifecycle rules for automatic deletion after a retention period. Configure these in the bucket settings.
  • S3 tool compatibility — Since R2 uses the S3-compatible API, you can access your stored documents with any S3 client (AWS CLI, Cyberduck, rclone) by pointing it to the R2 endpoint.
  • Migration from S3 — If migrating from Amazon S3, the same prefix and folder structure is maintained. Only the credentials and endpoint change in your FileRelay destination configuration.
  • No minimum storage duration — Unlike S3 Glacier or Infrequent Access tiers, R2 has no minimum storage duration charges. You can delete objects at any time without penalty.
  • Multipart uploads — R2 supports multipart uploads with no minimum part size requirement (unlike S3's 5MB minimum), simplifying large file handling.

Configuration Fields

FieldTypeRequiredDescription
bucketstringRequiredR2 bucket name
account_idstringRequiredCloudflare account ID
prefixstringOptionalPath prefix for stored objects

Credentials

FieldTypeRequiredDescription
access_keystringRequiredR2 API access key ID
secret_keystringRequiredR2 API secret access key

All credentials are encrypted at rest using envelope encryption.

Ready to set up Cloudflare R2?

Create a free account and add this connector in under 2 minutes.

Get Started Free