Skip to content

fix: sanitize client upload file keys#16697

Open
aerin-png wants to merge 1 commit into
payloadcms:mainfrom
aerin-png:fix/sanitize-client-upload-file-keys
Open

fix: sanitize client upload file keys#16697
aerin-png wants to merge 1 commit into
payloadcms:mainfrom
aerin-png:fix/sanitize-client-upload-file-keys

Conversation

@aerin-png
Copy link
Copy Markdown

fixes #16694

this makes client upload storage keys use the same filename sanitization behavior as upload filename generation.

before this, a filename like My Photo...png could be saved in the db as My Photo.png, while the storage key was still generated as My Photo...png.

added a regression test for getFileKey.

verified with:

npm exec --yes pnpm@10.33.2 -- vitest run packages/plugin-cloud-storage/src/utilities/getFileKey.spec.ts packages/payload/src/uploads/getSafeFilename.spec.ts

@aerin-png aerin-png requested a review from denolfe as a code owner May 20, 2026 09:07
@aerin-png aerin-png changed the title fix client upload file key sanitization fix: sanitize client upload file keys May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: clientUploads stores file under a different S3 key than the DB filename

1 participant