All guides

Practical working guide

A safe attachment workflow for website enquiries

Handle enquiry attachments through a restricted upload and review workflow: accept only needed formats, limit size, validate files on the server and control who can retrieve them. Do not treat a filename or browser-supplied content type as proof that a file is safe.

Turn the requirements into a developer handoff

OWASP recommends layered file-upload protection, including extension, type, size and access checks. The checklist below is an operational handoff, not evidence that a particular form already enforces these controls.

DecisionFill in before launch
Business needWhich document is genuinely needed at this stage?
Allowed formats and sizeExplicit allowlist and request limits
Storage and accessNon-public location, authorised retrieval and expiry
Validation and scanningServer checks, quarantine and failure response
Retention ownerWho deletes files when the purpose ends?

Sources: OWASP File Upload Cheat Sheet.

Worked test record

Fictional example: a survey form needs one floor-plan PDF, not identity documents. An authorised reviewer sees the submission only after validation; another customer cannot retrieve it. Test a harmless allowed file, an oversized file, a renamed disallowed file and an unauthorised download. Record expected result, actual result and evidence for each. A rejected upload should leave a clear message and preserve the rest of the enquiry where safe.

When a file cannot be accepted

Offer a secure alternative agreed with your technical team; do not ask customers to make private documents public. Keep suspicious content quarantined and follow your incident process. Recheck the workflow whenever allowed formats, storage or access rules change.

Use the related working templates