A document upload is not finished when a progress bar reaches the end. The application still needs to decide whether the file belongs there, who may retrieve it and what happens if processing fails.

If you are commissioning an invoice portal, a document workflow or an image-upload feature, agree five things before approving the upload screen: permitted content, validation and size limits, quarantine, authorized retrieval, and deletion or recovery. OWASP recommends layered controls rather than relying on one check such as a filename extension.[1]

This file upload security checklist turns that guidance into a buying brief: what the feature accepts, rejects, holds, stores and allows people to download. It is a planning framework, not a security certification or a report of tests on a working application.

Define the upload's purpose and allowed file types

Write one sentence for each upload purpose: ‘An authorized staff member attaches a supplier invoice to the matching purchasing record.’ Then decide which formats that job actually needs. Do not enable every document type just because the file picker can display it. OWASP advises allowing business-required extensions rather than unnecessary types.[1]

Keep an uploaded attachment distinct from an import. Storing a spreadsheet for later download is one feature; reading its rows and changing business records is another. For the latter, use the separate CSV import validation checklist.

Validate file content, not just the extension

A file called invoice.pdf is not necessarily a PDF. The browser-supplied Content-Type is also untrusted. OWASP recommends checking expected types and file signatures together, while warning that a signature check is not sufficient on its own.[1]

Ask the developer to specify server-side checks for each allowed format, including how malformed, password-protected or unsupported variants are handled. If an inspection tool cannot read a document, the proposed policy should hold or reject it—not quietly call it checked.

Images deserve the same care. Django's versioned security documentation describes a file with a valid PNG header followed by malicious HTML that may pass image verification but be served unsafely. It explicitly warns that a framework cannot provide a bulletproof validation solution for all uploaded content.[2]

The buying question is therefore not ‘Does the framework support uploads?’ It is ‘Which checks run, in which environment, and what remains untrusted afterward?’

Set upload, download and processing limits

Agree a maximum per-file size, files per operation, total request size and storage allowance. Also specify request-rate and processing limits. These are project decisions, not universal safe numbers. OWASP calls for upload and download limits, and for considering expanded size when files are decompressed; Django also recommends limiting upload size at the web server.[1][2]

For a first version, consider excluding archives unless the workflow genuinely needs them. OWASP notes that ZIP files bring many attack vectors.[1] If archives are required, ask for a separate extraction design covering expanded size, item count, nesting, destination paths and processing time. A small compressed upload must not be treated as a small processing job by assumption.

Quarantine uploads until required checks pass

Proposed workflow: receiving → checking → available, with rejected and checking-failed branches. Quarantine means keeping a received file unavailable for ordinary download, preview, email forwarding or downstream processing while checks are incomplete. This is an original suggested state model, not a claim about an installed product.

OWASP recommends antivirus or sandbox checking where available, with content disarm and reconstruction where applicable. It also warns about data leakage through public scanning services.[1] Ask which service receives the actual bytes, where it processes them and what retention or sharing terms apply before allowing confidential documents to leave the chosen environment.

A clean scan should be described as ‘passed the configured checks,’ not ‘guaranteed safe.’ Agree a policy for scanner timeouts and outages. The suggested default here is to leave files unavailable with an honest checking-failed state until an authorized recovery action occurs. A manual override, if required, needs its own permissions and audit record.

Separate storage safety from download authorization

Use a generated storage identifier rather than letting an incoming filename choose a destination. OWASP recommends generated filenames and storage on a separate host or outside the webroot, together with least-privilege permissions.[1] Keep the original name only as validated display metadata if the workflow needs it. Two invoices with the same displayed name should not overwrite each other accidentally.

Ask for proof that upload storage cannot execute the incoming file as application code. Django specifically warns against server handlers executing uploaded files.[2] For inline previews, have the developer review content types, response headers and origin isolation for the actual deployment; a preview is not merely a harmless version of download.

Download authorization is a separate acceptance requirement. Define who may upload, view, replace and delete each attachment, including organization boundaries. OWASP requires appropriate file-access permissions.[1] A generated identifier should not replace those checks. See the application permissions worksheet for a broader role matrix.

Complete a file-upload requirements worksheet

Use these rows in your project brief. Every row needs a named decision owner and a proposed acceptance check.

File-upload requirements worksheet — planning aid
DecisionFill in before buildEvidence to request
Purpose and accessBusiness record, permitted uploader, reader and organizationAllowed and denied access cases
Accepted contentRequired formats; unsupported, encrypted and malformed-file policyServer-side validation results
LimitsFile bytes, count, request total, storage and processing boundsBoundary and resource-limit cases
CheckingQuarantine rules, scanner/process owner, outage and override policyNo ordinary access before checks complete
Storage and displayGenerated keys, non-executable location, download/preview behaviorStorage/configuration review and retrieval checks
LifecycleRetention trigger, deletion responsibility, temporary files and backupsDeletion trace and documented backup treatment
RecoveryInterrupted upload, checking failure, retries and support referenceUser-visible state and diagnostic record

Retention is a business and privacy decision to confirm, not a number this article can supply. State what deletion means for originals, previews, temporary files and backup copies. Do not promise immediate removal everywhere if the agreed backup process cannot provide it.

Agree acceptance cases for success, failure and denied access

The following are conceptual, unrun cases for a fictional document portal. They are expected outcomes to agree with the developer, not observed test results. Use synthetic files and an isolated environment; never test dangerous content on production.

Fictional document portal acceptance cases — unrun
CaseExpected result to agree
Allowed document from an authorized userReceipt is recorded; ordinary retrieval becomes possible only after required checks pass
Unsupported extension, misleading type or malformed fileServer rejects or holds it according to policy, even if browser checks were bypassed
At, below and above each configured limitDefined boundary behavior; excess work is refused without an orphaned available attachment
Two documents with the same display nameDistinct stored objects; no unintended overwrite
Checking service unavailableChecking-failed or pending state remains unavailable; no false safe/success message
Another organization's user requests a known attachment identifierRetrieval is denied without disclosing document content
Upload stops midway, then the user retriesClear incomplete state and an agreed cleanup/retry result; no misleading duplicate attachment
Retention or deletion rule is reachedNormal access ends as agreed; derived files and backup limitations are accounted for

Ask the developer to run the agreed cases and record application, framework, server and inspection-tool versions, configurations, synthetic fixtures, dates and actual outcomes. Screenshots alone cannot prove server validation, storage isolation or authorization. Those need supporting request results and configuration review.

Approve the upload lifecycle, not just the button

Before sign-off, ask the team to demonstrate one accepted file, one rejection, one checking failure and one denied download. Then trace one deletion. If those paths are still undecided, the scope is not ready to call complete.

Preparing a web or application project? Use the CodeDrawn Digital project brief to describe the document's purpose, permitted users and the decisions above. The site's helper lets a visitor request an email draft; it does not confirm app opening, sending or receipt. Do not include real confidential files in an initial brief.

Sources

[1] OWASP File Upload Cheat Sheet — https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html

[2] Django 5.2 security: user-uploaded content — https://docs.djangoproject.com/en/5.2/topics/security

Primary sources checked 9 November 2026. Django 5.2 is a version-specific illustration, not a claim about the latest release or the stack chosen for your project.