payloadcms / payloadcms/payload
storage-vercel-blob: clientUploads makes the item unique after PUT so the new media link gets 404s and the existing file for non postfixed version is overwritten
@r1tsuu is already working on this.
Since Aug 17, 2026.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
If you upload the same filename twice, Payload creates a new media item (photo-1.jpg), but that original file uploaded never gets stored. The admin thumbnail looks fine. The main URL 404s. And the first photo.jpg in Blob gets overwritten, even though this is meant to be a new file.
What’s happening: with clientUploads: true, the browser PUTs photo.jpg first (allowOverwrite: true). Payload then uniquifies the new row to photo-1.jpg and only writes the sizes under that name. So photo-1-300x….jpg exists, photo-1.jpg does not, and the old photo.jpg blob is replaced.
It shouldn’t overwrite the old blob, and the new -1 row should have a file behind it. Local disk / server-side uploads already do this.
addRandomSuffix is not a workaround — it breaks image sizes (#9589).
Happy to open a 3.x PR that uniquifies the blob key before the client PUT
Link to the code that reproduces this issue
https://github.com/zakriabilal/payload-vercel-blob-filename-collision
Reproduction Steps
- You need your own Vercel Blob store and a BLOB_READ_WRITE_TOKEN. This does not reproduce on local disk.
- Clone https://github.com/zakriabilal/payload-vercel-blob-filename-collision
- Copy .env.example to .env. Set DATABASE_URL (local Mongo), PAYLOAD_SECRET, and BLOB_READ_WRITE_TOKEN.
- pnpm install && pnpm dev
- Create the first user at /admin
- Media → upload photo.jpg from the repo root
- Upload photo.jpg again as a new item (same filename)
- Library shows photo.jpg and photo-1.jpg. Both thumbnails look fine
- Open the original URL for photo-1.jpg — 404
- In the Vercel Blob store: photo-1-300x….jpg exists, photo-1.jpg does not, and the first photo.jpg was overwritten
Which area(s) are affected?
plugin: other
Environment Info
Binaries:
Node: 24.14.0
npm: 11.11.1
Yarn: 1.22.22
pnpm: 11.21.0
Relevant Packages:
payload: 3.88.0
next: 16.3.0
@payloadcms/db-mongodb: 3.88.0
@payloadcms/graphql: 3.88.0
@payloadcms/next/utilities: 3.88.0
@payloadcms/plugin-cloud-storage: 3.88.0
@payloadcms/richtext-lexical: 3.88.0
@payloadcms/storage-vercel-blob: 3.88.0
@payloadcms/translations: 3.88.0
@payloadcms/ui/shared: 3.88.0
react: 19.2.6
react-dom: 19.2.6
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.5.0: Tue Jun 9 22:28:29 PDT 2026; root:xnu-12377.121.10~1/RELEASE_ARM64_T6030
Available memory (MB): 18432
Available CPU cores: 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.