Chunked uploads#121
Open
petarjakopec wants to merge 3 commits into
Open
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.
Enables chunk uploads for larger files.
CloudinaryApiGateway::upload() now injects the chunk_size option into the Cloudinary SDK's upload() call when the source is a local readable file above a configurable threshold.
The SDK internally routes the transfer through postLargeFileAsync() (multipart PUT with Content-Range headers) instead of postSingleChunkAsync().
In cloudinary/cloudinary_php 2.x, chunking is purely option-driven via the standard upload() method. Implementation and docs have been synced to this SDK contract.
Configuration
Two new optional config keys added:
YAML
netgen_remote_media:
cloudinary:
large_upload_threshold: 100000000 # bytes, default: 100 MB
upload_chunk_size: 20000000 # bytes, default: 20 MB
📊 Observability
log_requests: true now distinguishes between chunked and single-request uploads in var/log/cloudinary.log.
Plaintext
[API][FREE] upload("/tmp/foo") [size=314572800B, chunked=yes (threshold=100000000B, chunk_size=20000000B)] -> Cloudinary\Uploader::upload("/tmp/foo")
[API][FREE] upload("/tmp/bar") [size=485762B, chunked=no (threshold=100000000B, chunk_size=20000000B)] -> Cloudinary\Uploader::upload("/tmp/bar")
[API][FREE] upload("https://...") [size=external/unknown, chunked=no] -> Cloudinary\Uploader::upload("https://...")
📁 Files Touched
Zero breaking changes:
✅ Test Plan
💡 Caveats (documented in INSTALL.md)