#18333·payload

storage-vercel-blob: clientUploads stores WebP, GIF and cropped uploads as 0-byte objects

Author: franknoelCreated Sep 26, 2026Updated Sep 29, 2026
Labelsplugin: cloud-storagearea: coreplugin: storage-*Bug

Describe the Bug

With clientUploads: true on @payloadcms/storage-vercel-blob, any client upload that Payload runs through sharp ends up stored as a 0-byte object, while the document keeps a non-zero filesize. That covers every WebP, GIF and TIFF (isAnimatedImage types), any image cropped in the same save as its client upload, and every resizable image when the collection sets resizeOptions, formatOptions, trimOptions or constructorOptions.

The mechanism on 3.90.2:

  1. getFileFromClientUpload returns the file with data: Buffer.alloc(0) and a tempFilePath (since #17856 / #17872, 3.89.0).
  2. generateFileData runs sharp for these files, then delete file.clientUploadContext (and fileForResize.clientUploadContext in the crop path). Because a tempFilePath exists, it writes the processed bytes only to that temp file (fs.writeFile(file.tempFilePath, …)) and leaves req.file.data empty.
  3. plugin-cloud-storage's afterChange no longer sees a clientUploadContext, so it stops skipping the file and calls adapter.handleUpload with buffer: file.data, the empty buffer.
  4. The Vercel Blob adapter puts that buffer with allowOverwrite: true at <prefix>/<_objectKey>/<filename>, replacing the file the browser had just uploaded with 0 bytes.

The deletes were added in 3.90.0 by 8e880a4763 ("fix: incorrect prefix from client upload"). The same deletes are on 3.x and on main (as uploadReference). JPEG, PNG and AVIF without edits are not affected unless the collection sets one of the options above: otherwise sharp does not run, clientUploadContext survives and afterChange skips them.

The GCS, R2 and UploadThing adapters also upload only file.buffer, so they should be affected the same way; S3 and Azure read tempFilePath when present. We only reproduced it on Vercel Blob.

A possible fix: have getIncomingFiles (or each adapter) read tempFilePath when present, as the S3 and Azure adapters do, or keep clientUploadContext and re-upload the processed file explicitly.

Link to the code that reproduces this issue

https://github.com/franknoel/payload-blob-client-upload-empty (blank template plus storage-vercel-blob with clientUploads: true; pnpm check compares each document's filesize with its stored object)

Reproduction Steps

  1. Configure storage-vercel-blob with clientUploads: true on an upload collection, with sharp set in the Payload config:
    typescript
    vercelBlobStorage({
      clientUploads: true,
      collections: { media: true },
      token: process.env.BLOB_READ_WRITE_TOKEN,
    })
  2. In the admin, upload a WebP (or a PNG with a crop set before saving). Save.
  3. The document shows the expected filesize, width and height, but head() or list() on the Blob store shows the object at 0 bytes, and the image URL returns an empty body.

We hit this on a staging site: WebP images editors uploaded after moving to 3.90 were stored as 0-byte objects. We reproduced the crop case locally.

Which area(s) are affected?

plugin: cloud-storage, plugin: storage-*, area: core

Environment Info

payload: 3.90.2
@payloadcms/plugin-cloud-storage: 3.90.2
@payloadcms/storage-vercel-blob: 3.90.2
next: 16.3.6
sharp: 0.35.4
Node: 24.21.0, deployed on Vercel