Describe the Feature
When a Payload app is deployed on Vercel and media uploads are sent through the server upload path, files larger than Vercel Functions' request body limit fail with a raw 413 Content Too Large / FUNCTION_PAYLOAD_TOO_LARGE network error.
It would be helpful if the Payload admin upload UI could detect this failure and show a clearer message with file-size context, for example:
Upload failed: this file is 5.1 MB, but this deployment can only accept about 4.5 MB through the server upload route. Enable client uploads for your storage adapter, or upload a smaller file.
Use Case
In a Payload 3 + Next.js + Vercel deployment using @payloadcms/storage-vercel-blob, uploading a 5.1 MB PDF to /api/media?depth=0&fallback-locale=null failed online with:
POST https://example.vercel.app/api/media?depth=0&fallback-locale=null 413 (Content Too Large)
The same file worked locally, and the Payload config had a larger upload limit, so the root cause was not obvious from the admin UI.
The fix was to enable direct client uploads:
vercelBlobStorage({
collections: { media: { disablePayloadAccessControl: true } },
clientUploads: true,
token: process.env.BLOB_READ_WRITE_TOKEN,
})
Proposed Improvement
When an admin upload request receives HTTP 413, display a specialized upload error that includes:
- the selected file size in MB
- the server/provider response status, e.g.
413 Content Too Large
- guidance that hosted/serverless providers may have lower request body limits than Payload's configured
upload.limits.fileSize
- for Vercel Blob / cloud storage adapters, a hint to enable
clientUploads
This would make the problem understandable without needing to inspect the browser console/network tab.
Related Context
Describe the Feature
When a Payload app is deployed on Vercel and media uploads are sent through the server upload path, files larger than Vercel Functions' request body limit fail with a raw
413 Content Too Large/FUNCTION_PAYLOAD_TOO_LARGEnetwork error.It would be helpful if the Payload admin upload UI could detect this failure and show a clearer message with file-size context, for example:
Use Case
In a Payload 3 + Next.js + Vercel deployment using
@payloadcms/storage-vercel-blob, uploading a 5.1 MB PDF to/api/media?depth=0&fallback-locale=nullfailed online with:The same file worked locally, and the Payload config had a larger upload limit, so the root cause was not obvious from the admin UI.
The fix was to enable direct client uploads:
Proposed Improvement
When an admin upload request receives HTTP
413, display a specialized upload error that includes:413 Content Too Largeupload.limits.fileSizeclientUploadsThis would make the problem understandable without needing to inspect the browser console/network tab.
Related Context
@payloadcms/storage-vercel-blobalready documents thatclientUploadsbypasses this limit.