Repository navigation
Description
The below is AI generated, but there's been a fair bit of revision to edit pare it back a bit.
Summary
The v4 storage adapter API removes capabilities that were available in v3:
- Carrying adapter-owned, verified data through signed upload receipts.
- Using that data to implement a storage layout different from Payload’s default.
We cannot find an equivalent extension point that retains Payload’s standard original-file tracking, transformations, history and cleanup behaviour.
We maintain an internal adapter for our preferred storage provider. The concern is the loss of adapter API flexibility, rather than a request for one particular storage layout.
Versions
| Package | Previous | Current |
|---|---|---|
payload |
3.90.1 |
4.0.0-beta.1 |
@payloadcms/plugin-cloud-storage |
3.90.1 |
4.0.0-beta.1 |
Background: this started with a recent v3 change
Previously, uploads used a flat storage layout by default.
A recent v3 update introduced per-upload UUID directories alongside signed upload receipts. We noticed this after upgrading, when new files started appearing inside these directories.
The v3 adapter API still gave us the tools to restore our preferred layout while keeping signed upload verification.
The v4 changes remove those tools and introduce stricter path assumptions in the standard upload flow.
What changed in the API
1. Receipts no longer accept adapter-owned context
In v3, createClientUploadReceipt() accepted context. Payload verified the receipt and passed its authenticated context to the storage handler.
An adapter could use this to carry a verified provider object ID or other provider-specific data from upload completion into the document save.
The v3 receipt implementation supported this. The v4 receipt implementation instead accepts a fixed set of storage-identity fields, without adapter-owned context.
2. Core removes supplementary reference fields
The v4 upload-instructions refactor (#17312) replaced clientUploadContext with uploadReference.
With requiresUploadReceipt: true, the subsequent receipt-validation change replaces the submitted reference with:
{
_objectKey: receipt._objectKey,
prefix: receipt.filePrefix,
signedReceipt,
}Returning additional data from the client upload handler therefore does not provide an alternative:
return {
...originalUploadReference,
providerObjectId,
signedProviderContext,
}Neither additional field reaches the server-side storage handler.
We are not asking Payload to trust client-supplied IDs. The adapter must verify them against the original upload authorisation before treating them as trusted data.
3. The standard receipt flow requires a particular path structure
The upload file-versioning implementation (#18548) added a check that an ordinary new upload’s original storage path ends in:
<filePrefix>/<objectKey>/<name-original.ext>
A path without the _objectKey directory is rejected before the storage handler runs.
The same PR also added UUID object-key generation for managed server-side uploads.
Example impact: flat storage
Our adapter previously used:
uploads/images/example.jpg
The standard v4 flow requires a structure such as:
uploads/images/<objectKey>/example-original.jpg
The extra directory is the concern here, not the -original suffix or UUID format.
Flat storage is one example of the flexibility lost. The broader issue is that adapters can no longer use signed provider context to implement their own verification and storage decisions through the standard flow.
Why opting out is not equivalent
Setting requiresUploadReceipt: false preserves supplementary reference fields and avoids the directory check.
However, in equivalent no-transform tests, Payload stopped populating original. This does not preserve the same automatic original-file tracking and cleanup behaviour.
Using private _payload… request-context fields to restore that behaviour would also create an unsupported dependency on core internals.
Expected behaviour
The adapter API should provide a supported way to:
- Carry authenticated, adapter-owned upload context.
- Resolve the provider object and its physical storage path.
- Retain core receipt checks, original-file tracking, transformations, history and rollback support.
Restoring signed receipt context—or providing an equivalent verification/finalisation hook—would address the first part.
Adapters should also be able to choose their physical storage layout without opting out of core file-management support.
We understand the need for distinct upload identities and safe handling of retained files. The regression is the loss of extension points that previously let adapters meet those requirements without adopting Payload’s default directory structure.
Activity
nathanlentz commentedon Oct 16, 2026
Hi @damnsamn, thank you for the feedback here. I'd agree there is a gap and I want to work towards closing it.
I'm going to come up with a few ideas that should help you out. If I dump them here can you let me know if they'll work for you?
damnsamn commentedon Oct 17, 2026
Hey @nathanlentz, yeah totally mate
-originalsuffix, even without transformations or versioning #18824nathanlentz commentedon Oct 22, 2026
@damnsamn Alright! Sorry, I've been thinking about this a lot. I think I have a plan for all of your concerns but I am still working on how to maintain reliable file versioning if an adapter chooses to use flat storage since the current design was written around having unique storage paths per file.
My current plan:
adapterDatainto the upload receipt. It'll be signed by Payload and sent back to your adapter later after upload.uploadReference(like yourproviderObjectIdexample) reach your adapter in something likeuploadReference.clientData. They're unverified, so check them before use.@internalfromrequiresUploadReceiptand receipt signing to make it publicresolveStorageKeyfunction which will be used everywhere core builds a key so you can decide where objects live.Again, there is inherent complexity with a flat storage layout when every version of a document needs to reliably point at its own physical file. Still thinking through how Payload core can support this.
damnsamn commentedon Oct 23, 2026
Appreciate the thought and effort @nathanlentz. This looks like a good direction to me
I think when it comes to versioning and transformations - mandating a unique storage path does make more sense. I can imagine the complications that would come with managing and mitigating filename clashes or whatever else in a flat structure. Overall I think if accommodating unknown folder structures is going to overcomplicate the solution or the API - I don't mind accepting that a nested folder structure on the storage end is a requirement for payload uploads to function properly.
Even conceding the folder structure, I do still think that your
adapterData/clientDataseparation does resolve a regression in the API by allowing us to identify and verify the provider object as we were before the upload versioning changes.fix: public upload receipts with signed adapterData (#19032)
fix!: pass extra uploadReference fields as clientData (#19033)
nathanlentz commentedon Oct 26, 2026
@damnsamn I've merged two PRs for you. The changes will be in the next beta for you to check out.
damnsamn commentedon Oct 27, 2026
Beautiful mate thanks!
github-actions commentedon Oct 27, 2026
🚀 This is included in version v4.0.0-beta.5