Skip to content

S3 Storage plugin ignores Payload-wide upload limits when using client-side uploads #12671

Closed

Description

@timothylp

Describe the Bug

When enabling client-side uploads using the s3Storage plugin, the global Payload upload options (such as abortOnLimit and limits.fileSize) are not respected. This leads to scenarios where users can upload files exceeding the defined size limits without triggering any validation or error.

This behavior differs from server-side uploads, where the global upload configuration is correctly applied.

Link to the code that reproduces this issue

https://github.com/timothylp/s3storage-client-uploads-limit

Reproduction Steps

  1. Initialize Payload with the blank template.
  2. Install and configure the s3Storage plugin (I personally use it with Cloudflare R2).
  3. Enable clientUploads in the relevant collection.
  4. Define global Payload-wide upload options in payload.config.ts:
upload: {
  abortOnLimit: true,
  limits: {
    fileSize: 1024 * 1024 * 2, // 2MB
  },
}
  1. Use the Admin Panel or a custom client to upload a file larger than 2MB (for example).
  2. No error is thrown.

Which area(s) are affected? (Select all that apply)

plugin: cloud-storage

Environment Info

Binaries:
  Node: 20.18.1
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.15.4
Relevant Packages:
  payload: 3.40.0
  next: 15.3.0
  @payloadcms/email-nodemailer: 3.40.0
  @payloadcms/graphql: 3.40.0
  @payloadcms/next/utilities: 3.40.0
  @payloadcms/payload-cloud: 3.40.0
  @payloadcms/plugin-cloud-storage: 3.40.0
  @payloadcms/richtext-lexical: 3.40.0
  @payloadcms/storage-s3: 3.40.0
  @payloadcms/translations: 3.40.0
  @payloadcms/ui/shared: 3.40.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:43 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8132
  Available memory (MB): 16384
  Available CPU cores: 10

Activity

  1. added
    status: needs-triage
    validate-reproduction
    on Jun 4, 2025
  2. removed
    validate-reproduction
    on Jun 4, 2025
  3. timothylp commented on Jul 11, 2025

    @timothylp
    Author

    Any updates on this? The issue is still present in version 3.46.0, preventing us from exceeding the 2MB limit on Vercel.

  4. timothylp commented on Aug 15, 2025

    @timothylp
    Author

    The issue still occurs in version 3.51.0. I tried using a beforeOperation hook to force validation, but the upload seems to happen beforehand in all cases. Even when triggering an error in the UI, which prevents the entity from being created in the database, the file is still uploaded to S3. This is likely the same behavior affecting another user in this issue: #13299

  5. removed
    status: needs-triage
    on Jan 12, 2026
  6. github-actions commented on Jan 21, 2026

    @github-actions
    Contributor

    This issue has been automatically locked.
    Please open a new issue if this issue persists with any additional detail.

  7. locked as resolved and limited conversation to collaborators on Jan 21, 2026
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