⚡ Threshold Test Files
Byte-precise files for boundary-value testing against upload limits.
What is boundary value testing
Many services cap file sizes. Testing at exactly the limit, just under it, and just over it efficiently verifies the validation logic.
Below the limit — upload should succeed.
On the boundary — verify success behavior.
Above the limit — should return an error.
PNG
JPG
ZIP
Upload limits of major services
| Service | Limit | Test files |
|---|---|---|
| Gmail attachment | 25MB | 24.9MB / 25MB / 25.1MB |
| Discord (free) | 25MB | 24.9MB / 25MB / 25.1MB |
| WordPress (default) | 10MB | 9.9MB / 10MB / 10.1MB |
📖 Where people get stuck
Files aligned to the byte just under, exactly on, and just over a boundary — 9.9 / 10.0 / 10.1 MB. One pass tells you whether a limit means "at most" or "less than", and which layer rejects you. Equally, it tells you nothing else: throughput and behaviour under concurrency need measuring separately.
| Case | What happens | What to do |
|---|---|---|
| A 10 MB limit rejects a 10 MB file | Whether 10 MB means 10,000,000 bytes or 10,485,760 (10 × 1024²) differs by 480 KB, and both readings exist in the wild. |
Establish which reading applies before anything else. See file size units for the mapping and the byte converter to convert. |
| It fails with no error message | When nginx rejects on client_max_body_size, the 413 comes back before PHP is ever reached, so nothing lands in the application log. |
Look at the nginx access and error logs to tell them apart. What 413 means and how to handle it is written up in the 413 article. |
| The exact boundary passes sometimes and not others | If the check is on the whole request rather than the file, a file sitting exactly on the boundary goes over by the size of the headers — and the filename length shifts it too. | Put the 9.9 MB and 10.1 MB results side by side and see which side the behaviour flips on. If both fail, the real threshold is lower than you think. |
A boundary behaving correctly says nothing about several near-limit files arriving at once. Check that upload_max_filesize multiplied by your concurrency still fits in the disk and memory you have.