Custom Chunk Size
Set a custom chunk size with chunkSize. This example uses 2 MB chunks instead of the default 5 MB, which can be useful for slower connections.
Chunk size: 2 MB
new MultipleUpload(document.getElementById('demo-chunk-size'), {
uploadUrl: '/api/upload',
multiple: true,
chunked: true,
chunkSize: 2 * 1024 * 1024 // 2 MB
});
Choosing the slice size
chunkSize defaults to 5 MB. It sets how much of the file each request carries, and it is the main lever on how a large upload behaves when the network is unreliable.
The trade the number represents
Smaller chunks mean less to re-send after a failure and finer-grained progress, at the cost of more requests and more per-request overhead. Larger chunks are more efficient on a good connection and more expensive to lose on a bad one. If uploads are failing and retrying on mobile, a smaller chunk is usually the fix; if throughput is the complaint on fast links, raise it or raise chunkConcurrency instead.
The direct-to-cloud strategies impose their own constraints — GCS requires every chunk but the last to be a multiple of 256 KiB, and the strategy rounds your value down to that grain.