Configuration
Settings live at Settings → Plugins → Chunky, and every one can be set in config/chunky.php
instead, which is where they belong on a site with more than one environment:
<?php
return [
'chunkSize' => '4MB',
'maxUploadSize' => '2GB',
'maxRetries' => 3,
];
enabled
Default: true.
The master switch. Off, every uploader in the control panel behaves exactly as Craft ships it — Chunky's only intervention is a per-file decision made at the moment a file is submitted, so switching it off is complete and immediate.
chunkSize
Default: 4MB. Accepts a shorthand string (4MB, 512KB) or a byte count.
How much of a file goes in each request. This is the only size that has to fit through anything.
The default is deliberately timid. It fits inside every upload_max_filesize worth calling a limit,
and inside Cloudflare's free-plan 100 MB request cap with two orders of magnitude to spare. Bigger
chunks mean fewer round trips and a faster upload; they also mean more to redo when one fails, and a
larger request for something upstream to object to.
Anything below 64 KB or above 512 MB is rejected as a typo rather than a preference.
maxUploadSize
Default: 2GB.
The largest assembled file Chunky will accept. Checked against the size the browser declares on the first chunk, so a file that cannot succeed is refused before the second one is sent.
Note this is Chunky's own ceiling and has nothing to do with Craft's maxUploadFileSize general
config setting, which caps what Craft's own uploaders will offer to send in a single request.
applyToAssetIndex, applyToFields, applyToReplace
Default: true for all three.
Which control panel uploaders Chunky decorates: the Assets screen, Assets fields on any element edit screen, and “Replace file”. Switching one off returns that uploader to Craft's stock behaviour.
The Assets screen and an Assets field both post to the same Craft action, so Chunky tells them apart by the shape of the settings Craft builds the uploader with — an Assets field always supplies a file-limit callback and the Assets index never does. Switching a screen off returns its uploader to stock behaviour completely, including Craft's own client-side size limit.
Chunky never touches user photos, site images, or another plugin's upload action, and there is no setting to make it.
maxRetries
Default: 3. 0 disables retrying.
How many times a chunk that failed for a reason that might not happen twice is retried. Before each retry the browser asks the server how much of the file it is actually holding and resumes from there — the request that failed may well have been written in full before the connection went, and resuming from a stale offset would write the same bytes twice into the middle of the file.
Only network-shaped failures are retried: a dropped connection, a timeout, a 5xx, a 429. A 4xx is Craft or Chunky refusing on purpose, and saying it again more slowly does not help.
retryDelay
Default: 1000 (milliseconds).
The wait before the first retry. Each subsequent retry waits twice as long as the one before it, because the failures worth retrying are the ones where something upstream is briefly unhappy, and hammering it on a fixed interval is how a blip becomes an outage.
partialLifetime
Default: 86400 (seconds — one day). Minimum 300.
How long an unfinished upload may sit in storage/runtime/chunky before garbage collection removes
it. A browser tab closed mid-upload leaves one behind every time, so this is not a rare case.