Docs · Guides

Receive SFTP uploads into S3 or R2

Partners keep using SFTP; every file lands in your own bucket, written with a key that can do nothing else.

Your partners upload over SFTP as usual. Each file is then written to your own bucket, under a prefix you choose and keeping its path: a partner's upload to /northwind/invoices-2026-11.csv becomes the object sftp/northwind/invoices-2026-11.csv. Bucket delivery is part of the Pro and Business plans.

1a. An Amazon S3 bucket and a write-only key

With the AWS CLI, create the bucket, a user for SFTP Harbor, and a policy that lets that user write under sftp/ and nothing else. It cannot list, read or delete objects.

aws s3api create-bucket --bucket acme-sftp-inbound --region eu-west-2 \
  --create-bucket-configuration LocationConstraint=eu-west-2
aws iam create-user --user-name sftp-harbor-delivery

Save this as policy.json, with your bucket name:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "WriteUploadsUnderPrefix",
      "Effect": "Allow",
      "Action": ["s3:PutObject", "s3:AbortMultipartUpload"],
      "Resource": "arn:aws:s3:::acme-sftp-inbound/sftp/*"
    }
  ]
}
aws iam put-user-policy --user-name sftp-harbor-delivery \
  --policy-name write-sftp-uploads --policy-document file://policy.json
aws iam create-access-key --user-name sftp-harbor-delivery

The last command prints an AccessKeyId and a SecretAccessKey. You need both in step 2. s3:PutObject also covers the multipart uploads used for files over 32 MB; s3:AbortMultipartUpload lets an interrupted one be cleaned up.

1b. Or a Cloudflare R2 bucket and token

  1. In the Cloudflare dashboard, open R2 and create a bucket, for example acme-sftp-inbound.
  2. Under Manage API tokens, create a token with Object Read & Write permission, applied to that bucket only.
  3. Copy the Access Key ID, the Secret Access Key and the S3 endpoint, https://<ACCOUNT_ID>.r2.cloudflarestorage.com.

2. Add the destination

In the dashboard, open Advanced → Destinations and choose Add destination. Because a destination receives every uploaded file, you will be asked to confirm your password, and your account needs two-factor authentication.

Field Amazon S3 Cloudflare R2
Endpoint Leave empty https://<ACCOUNT_ID>.r2.cloudflarestorage.com
Bucket acme-sftp-inbound acme-sftp-inbound
Region eu-west-2 auto
Key prefix sftp sftp
Applies to All SFTP users, or one partner
After delivery Copy keeps the file in SFTP Harbor as well; move deletes it here once delivered

Choose Test. With the write-only S3 key above you will see “Connected: a test file was written, but could not be deleted (the key may be write-only, which is fine).” The test leaves one small sftp/.harbor-test-… object, which you can delete.

3. Upload a file and find it in the bucket

As a partner would, with the SFTP user's key:

printf 'invoice,amount\n1,100\n' > invoices-2026-11.csv
sftp -i ~/.ssh/northwind -b - northwind@data.sftpharbor.com <<'EOF'
put invoices-2026-11.csv
EOF

Then, with your own AWS credentials (the delivery key cannot list):

aws s3 ls s3://acme-sftp-inbound/sftp/ --recursive
# For R2, add: --endpoint-url https://<ACCOUNT_ID>.r2.cloudflarestorage.com

Delivery starts as soon as the upload is closed. Advanced → Destinations lists each delivery with its status; failed ones are retried automatically, and you can retry one yourself. If the server holds uploads for review, delivery starts when you release the file.

Next