Skip to content

[v4 beta] Filename regression: uploads get an unconfigurable -original suffix, even without transformations or versioning #18824

Closed

Description

@damnsamn

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

  1. Configure an upload collection with versioning disabled:

    {
      slug: 'documents',
      versions: false,
      upload: {
        mimeTypes: ['application/pdf'],
      },
      fields: [],
    }
  2. Do not register any file transformers.

  3. Upload a file named privacy-policy.pdf.

  4. Inspect the resulting document’s filename and 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

  1. Anant3008 commented on Oct 19, 2026

    @Anant3008

    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.

  2. self-assigned this
    on Oct 20, 2026
  3. damnsamn commented on Oct 23, 2026

    @damnsamn
    ContributorAuthor

    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?

  4. nathanlentz commented on Oct 26, 2026

    @nathanlentz
    Collaborator

    @damnsamn I'm putting thought into this one as well.

  5. damnsamn commented on Oct 26, 2026

    @damnsamn
    ContributorAuthor

    @nathanlentz much appreciated mate!

  6. nathanlentz commented on Oct 29, 2026

    @nathanlentz
    Collaborator

    @damnsamn I just opened up #19210 to remove the use of the -original suffix.

  7. nathanlentz commented on Nov 2, 2026

    @nathanlentz
    Collaborator

    @damnsamn This change will be available for you in the next release!

  8. damnsamn commented on Nov 3, 2026

    @damnsamn
    ContributorAuthor

    @nathanlentz you're a weapon mate, thanks for handling these

  9. added a commit that references this issue on Nov 3, 2026
    fcf090d
  10. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    🚀 This is included in version v4.0.0-beta.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions