fix(storage-s3): support S3 client uploads over 5 GiB via multipart#17005
Open
codyparnell wants to merge 3 commits into
Open
fix(storage-s3): support S3 client uploads over 5 GiB via multipart#17005codyparnell wants to merge 3 commits into
codyparnell wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which branch?
Targets
main(Payload v4).What?
Fixes S3 client uploads failing for files larger than 5 GiB.
AWS S3 limits single
PutObjectuploads to 5 GiB. This PR ensures the S3 client upload handler automatically switches to multipart upload for larger files, and documents the related Payload config requirements.Why?
With
clientUploads: true, files upload directly from the browser to S3. That bypasses server/Vercel body-size limits, but two constraints still apply:PutObjectURL.upload.limits.fileSize— the signed-URL signer still enforces this limit for both single-part and multipart flows.Without multipart routing and clear configuration guidance, large client uploads fail (e.g.
Exceeded file size limitoninitiateMultipartorgenerateSignedURL).How?
Client (
S3ClientUploadHandler)generateSignedURL→ S3PUT)initiateMultipartcompleteMultipart(withabortMultiparton failure)Server (
generateSignedURLhandler)initiateMultipart,signMultipartPart,completeMultipart,abortMultipartupload.limits.fileSize: Infinityas no signer-side capinitiateMultipart: Exceeded file size limit) for easier debuggingDocs & tests
upload.limits.fileSizeinpackages/storage-s3/README.mdtest/storage-s3/client-uploads/User-facing config requirement
Users uploading large files must raise the global limit to match their largest expected file: