Skip to content

Conversation

rjgtav
Copy link
Contributor

@rjgtav rjgtav commented Sep 30, 2025

What?

Use the correct Content-Type when uploading files to R2.

Why?

While R2 can infer the Content-Type of most uploads, in some scenarios it will fail (e.g. when uploading an SVG image).

How?

By passing the file's MIME type as the Content-Type header.

Bug report: https://discord.com/channels/967097582721572934/1422639568808841329/1422645245534797914

Copy link
Contributor

Pull Request titles must follow the Conventional Commits specification and have valid scopes.

Unknown scope "storage-r2" found in pull request title "fix(storage-r2): upload with the correct contentType". Scope must match one of: cpa, db-*, db-mongodb, db-postgres, db-vercel-postgres, db-sqlite, drizzle, email-*, email-nodemailer, email-resend, eslint, graphql, live-preview, live-preview-react, next, payload-cloud, plugin-cloud, plugin-cloud-storage, plugin-form-builder, plugin-import-export, plugin-multi-tenant, plugin-nested-docs, plugin-redirects, plugin-search, plugin-sentry, plugin-seo, plugin-stripe, richtext-*, richtext-lexical, richtext-slate, sdk, storage-*, storage-azure, storage-gcs, storage-uploadthing, storage-vercel-blob, storage-s3, translations, ui, templates, examples(/(\w|-)+)?, deps.

feat(ui): add Button component
^    ^    ^
|    |    |__ Subject
|    |_______ Scope
|____________ Type

@paulpopus paulpopus merged commit 066997d into payloadcms:main Oct 4, 2025
93 of 94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants