A small staging test for AI-built apps: separate the file picker, the network filter, and the server that accepts the upload.
On November 27, Cloudflare added multipart inspection fields that let its Rules engine examine more of an upload request's structure, including the headers attached to individual parts. The fields require an Enterprise plan. You don't need that plan to learn something useful from the accompanying limitation: seeing part of a request is not the same as validating the file your app eventually stores.
Cloudflare's field reference says body inspection has a size limit. When that limit is exceeded, body fields can be truncated while the origin server still receives the complete request. A network filter can therefore be working as documented without having examined every byte of your upload.
For a beginner building with AI, I'd turn that distinction into a release test, not another reassuring badge beside the upload button.
Give each layer a specific job
Imagine a fictional client portal that accepts a JPEG profile photo up to 5 MiB. The file picker can guide people toward the right file. An edge filter can reject requests under its configured rules. The application server still needs to enforce the portal's own acceptance policy before treating a photo as ready.
Write that policy in terms you can test: one JPEG, no more than 5,242,880 file bytes, successfully decoded within chosen pixel and processing limits, associated with an authorized test user. Pick limits appropriate to your app; those numbers are an example, not a universal recommendation.
Keep the file-size limit separate from the request-size limit. A multipart request also contains boundaries, headers, and other form fields. If both limits are the same number, an otherwise valid file at the advertised maximum may fail because the envelope adds bytes.
Test the promise without the file picker
In your own isolated staging environment, use synthetic files and the same authenticated upload route the app uses. Ask your coding assistant to build a small integration test that sends the request directly. Keep the normal server checks enabled. This checks whether the server enforces the policy even when browser-side validation isn't involved.
Start with a valid small JPEG as the control. Then submit harmless text named photo.jpg with a claimed image content type. The server should reject it as an invalid image, not accept the client's label as proof. OWASP's upload guidance makes the same important distinction: the sender supplies the content-type header, so it cannot establish trust by itself.
Next, test valid image fixtures below, exactly at, and above the documented file-byte boundary. Record their actual byte counts. A large file that can't be decoded is a useful malformed-file test, but it doesn't isolate size enforcement. Give each test one reason to pass or fail.
Also send two files when the policy allows one. Verify that the request is rejected according to the policy rather than silently storing whichever file the framework happened to select.
Check the result in storage, too
A red error message alone isn't enough. After each rejected request, check that no accepted-photo record or publicly usable file was created. If your implementation temporarily stores uploads for validation, verify that rejected content stays inaccessible and is removed under the documented cleanup policy. Don't confuse temporary quarantine with a successful upload.
Then run the valid control again. A fix that blocks everything would pass every rejection test while breaking the feature. Verify that the accepted file belongs to the right test user, can be retrieved only through the intended access path, and replaces nothing unexpectedly.
One extra case matters when your app uses direct-to-storage uploads: uploading bytes and marking the photo ready are separate steps. Apply the same validation and authorization expectations at finalization. Otherwise, the carefully tested application route may not be the route that decides what becomes usable.
Keep evidence small and repeatable
I would keep a fixture manifest with each file's name, byte count, expected decision, and the reason for that decision. The test report should identify the app version and which layer rejected the request. Use synthetic files; you don't need customer photos or full request bodies in logs to prove this behavior.
These checks aren't a complete upload security review. They establish something narrower and valuable: your advertised upload policy is enforced by the system that accepts the data, not merely suggested by its interface.
My release criterion would be a valid control that still works, specific invalid cases that fail for the intended reason, and storage that agrees with both outcomes.
This article was prepared with AI assistance. The client portal and its limits are hypothetical examples.
