I have successfully synced files from a local file system to Cloudflare R2 using rclone.
A bunch of files, because they are served programmatically, have a
.data extension. The underlying content type of the files is correct:
file --mime-type -b 99-e0124c7f9f33974f4929c543dfdf5f33.data image/jpeg
But in place on Cloudflare R2 the files have a content type of application/octet-stream
rclone v1.65.0-beta.7480.e1b0417c2 - os/version: ubuntu 22.04 (64 bit) - os/kernel: 6.2.0-1012-aws (x86_64) - os/type: linux - os/arch: amd64 - go/version: go1.21.4 - go/linking: static - go/tags: none
The issue persisted in this beta version, but I was also on the latest stable version previously.
rclone sync . R2:internal/ --verbose --transfers 64 --checkers 64
rclone sync . R2:internal/ --verbose --transfers 64 --checkers 64 --metadata
Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.
[R2] type = s3 provider = Cloudflare access_key_id = XXX secret_access_key = XXX region = auto endpoint = https://XXX.r2.cloudflarestorage.com
Worth noting that
.data files could essentially be any content type. I'm assuming rclone is doing some sort of file extension coercion to ascertain the content type here.
Ideally it would be utilising whatever content type actually exists in the file metadata but this does not happen.
In an ideal world, I believe that if no content type is set at all, then Cloudflare R2 will automatically infer it itself. That would be a sufficient solution if it was possible to do that with rclone.
Any help would be greatly appreciated. Thanks!