npx wrangler r2 object put my-assets/report.pdf --file ./report.pdf --content-type application/pdf
Upload a file with an explicit content type
Same upload as the plain put but pins the Content-Type header to application/pdf, which matters when R2's guess would be wrong or when serving files directly to users. Other header flags like --cache-control and --expires control edge caching. --force skips the data catalog validation prompt.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.