Hi there! I'm running a Docker container on a VPS. I want to write a shell script that can put fil

Hi there!

I'm running a Docker container on a VPS. I want to write a shell script that can
put files from the container into a Cloudflare R2 bucket. I've read through the
docs, and it seems like my best options are: wrangler, rclone, aws CLI, Workers API.

Is it not possible to simply use a curl command to a Cloudflare REST API
endpoint? For example:

curl -X PUT "https://${ACCOUNT_ID}.r2.cloudflarestorage.com/${BUCKET_NAME}/${object_key}" \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Content-Type: application/octet-stream" \
  --data-binary "@$FILE_PATH"

I'd prefer to do something like this, rather than add
wrangler
,
rclone
or
aws
to my Docker container, or spin up a Cloudflare Worker. Thanks in advance
for the help!
Was this page helpful?