Installation
Requirements
- Craft CMS 5.3 or later
- PHP 8.2 or later
- A writable
storage/runtimedirectory - Enough free disk for the largest upload you intend to allow, twice over
Install
composer require justinholtweb/craft-chunky
php craft plugin/install chunky
Nothing else. Large uploads in the control panel start arriving in 4 MB pieces immediately, and small ones carry on going to Craft's own upload action exactly as before.
Check the environment report first
Settings → Plugins → Chunky reads the limits it can see and says whether the chunk size clears them. Two of them are the ones that matter:
upload_max_filesizemust be larger than the chunk size.post_max_sizemust be larger than the chunk size plus the form fields sent with it.
If either is smaller, every large upload fails, and the fix is to lower Chunky's chunk size rather than to raise anything.
The limits nothing in PHP can read
Below those, the report lists the ones Chunky has no way of checking. These reject a chunk before the request ever reaches Craft, so nothing is written to the log and the browser reports a bare 413:
nginx
client_max_body_size— defaults to 1 MB, which is smaller than Chunky's default chunk. On nginx this is usually the first thing to set:client_max_body_size 8m;Apache
LimitRequestBody— unlimited by default, but frequently set by a host.- A CDN or proxy request cap. Cloudflare's free plan caps a request body at 100 MB. Keeping the chunk size well under a cap like that is the reason chunking helps at all.
Chunky recognises a 413 and says so in the error, naming these as the place to look, rather than showing the generic “upload failed” that sends people looking in Craft.
Verifying it
Drag something larger than the chunk size onto the Assets screen. In the browser's network panel you
should see several POSTs to chunky/upload/chunk, each with a Content-Range header, and each
answering with a Range header — followed by a normal-looking asset appearing in the index.
Drag something smaller than the chunk size and you should see a single POST to assets/upload,
because Chunky left it alone.