How to Test File Upload Limits (N-1, N, N+1)
How to test file upload limits: send one byte under, at and over each limit, and allow for multipart and base64 overhead. Includes real curl output.
Updated
Practical guides for testing upload limits, reading byte sizes correctly and validating uploads. Commands were run before they were written down, and where we did not run something the guide says so and cites the vendor documentation. Need a file to test with? Use the dummy files generator.
How to test file upload limits: send one byte under, at and over each limit, and allow for multipart and base64 overhead. Includes real curl output.
Updated
Fix nginx 413 request entity too large: raise client_max_body_size (default 1m), reload, and verify with byte-exact test files. Real nginx output.
Updated
PHP upload_max_filesize limits each uploaded file, post_max_size the whole request. Defaults, what fails when, and a boundary test with real output.
Updated
KB vs KiB: 1 KB is 1,000 bytes, 1 KiB is 1,024, and many tools say KB for both. Exact byte tables, real ls and head output, and why it matters.
Updated
Create a dummy file of any size with one command: fsutil or PowerShell on Windows, truncate, dd or head on Linux, mkfile on macOS. Real output and caveats.
Updated
File signature magic bytes for PDF, ZIP, RAR, 7z, gzip, PNG, JPEG and Windows PE, plus how to validate uploads without trusting file names.
Updated