Repository navigation
Description
Below was generated by AI, but manually proof-read and vetted
Summary
Payload v4 appends -original to uploaded filenames even when:
- No file transformers are configured.
- Versioning is disabled for the collection.
- The uploaded file is intended to be served directly to website users.
This changes a user-facing filename without an apparent need or a supported configuration option to preserve it.
A client uploading privacy-policy.pdf should not have that file renamed to privacy-policy-original.pdf by default.
Versions
| Package | Previous | Current |
|---|---|---|
payload |
3.90.1 |
4.0.0-beta.1 |
Background
The upload file-versioning implementation (#18548) introduced retained originals and the -original filename suffix.
Keeping an original source is useful when Payload creates other representations or retains file history.
However, the suffix also becomes the normal filename when neither feature is in use. In that case, there is no processed version to distinguish from an “original”.
Reproduction
-
Configure an upload collection with versioning disabled:
{ slug: 'documents', versions: false, upload: { mimeTypes: ['application/pdf'], }, fields: [], }
-
Do not register any file transformers.
-
Upload a file named
privacy-policy.pdf. -
Inspect the resulting document’s
filenameand generated file URL.
Actual behaviour
Uploaded: privacy-policy.pdf
Result: privacy-policy-original.pdf
The renamed file is the one normally linked from the website—not merely an internal backup or source copy.
Expected behaviour
Uploaded: privacy-policy.pdf
Result: privacy-policy.pdf
Normal filename sanitisation and collision handling should still apply.
Why this matters
This is a visible change from v3, not just an internal storage detail.
For clients managing documents:
- The published filename no longer matches the file they uploaded.
- “Original” can suggest that another, processed or final version exists.
- Internal file-management terminology appears in public links and filenames.
For example, a privacy policy, application form or annual report usually needs no transformation. Adding -original makes these filenames less clear without providing a benefit to the client or website user.
Configuration gap
Disabling versioning and leaving transformers unconfigured does not prevent the suffix.
We could not find a supported option to disable or customise it. Preserving an ordinary public filename should not require a post-upload rename or custom file-management code.
Expected behaviour / requested change
Preserve the uploaded filename by default when transformations and versioning are not in use.
Where Payload needs a separate retained source, its internal naming should not unnecessarily change the filename presented to website users.
If -original must remain the default, provide a supported option to disable or customise it while keeping file tracking, rollback and cleanup correct.
Activity
Anant3008 commentedon Oct 19, 2026
Hey @damnsamn , I'd like to work on this issue. I'll investigate the filename generation and file-versioning logic, add regression tests for uploads without transformers and with versioning disabled, and ensure the fix preserves existing file tracking and collision handling.
damnsamn commentedon Oct 23, 2026
Hey @nathanlentz - just following up on this issue rather than tacking this onto #18763 since they're (sorta) related
When I think of these two issues with upload storage behaviour on v4, this is definitely the one that would be blocking us moving to v4 right away at this stage.
I understand that reserving a distinct name for the input file makes sense for cases where a transformer legitimately wants to preserve the input filename. But this internal filename convention as an implementation detail becoming the public filename even when the upload is untouched by any transformations is a concern. Maybe preserving
-original-named files becomes conditional on whether file transformers are configured to touch a given file?nathanlentz commentedon Oct 26, 2026
@damnsamn I'm putting thought into this one as well.
damnsamn commentedon Oct 26, 2026
@nathanlentz much appreciated mate!
nathanlentz commentedon Oct 29, 2026
@damnsamn I just opened up #19210 to remove the use of the
-originalsuffix.nathanlentz commentedon Nov 2, 2026
@damnsamn This change will be available for you in the next release!
damnsamn commentedon Nov 3, 2026
@nathanlentz you're a weapon mate, thanks for handling these
fix!: remove -original suffix from retained upload originals (payload…
github-actions commentedon Nov 4, 2026
🚀 This is included in version v4.0.0-beta.7