BlogGuides · September 28, 2026 · 5 min read

Contact Form 7 File Uploads: Configure Attachments and Test the Full Path

Configure CF7 file fields and mail attachments, check size limits, and build a test matrix that separates upload, sending and recipient outcomes.

A paperclipped document passes through a frame toward an envelope beside a form card.
Conceptual illustration generated for this article; not a product screenshot or measured result.

A file can be selected in a Contact Form 7 field without ever arriving as an email attachment. The upload field, server limits, mail configuration and receiving mailbox each participate in the journey. Testing only the form’s green success message leaves several of those steps unverified.

This guide provides a small attachment setup and a practical test plan. It is intended for forms collecting ordinary supporting documents, not for building a document-storage system. Use synthetic files during testing and decide where real documents should be retained before inviting visitors to upload them.

Define the smallest useful upload requirement

Start with the business question: what does the team need to read in order to respond? A quotation request might need a short PDF brief; it may not need a large archive of original images. Set a file-type policy and a size limit that reflect that use case, then explain both beside the field.

Decide whether the attachment is necessary to submit the inquiry. Making it optional can let someone ask an initial question when they do not have the document available. Making it required may be appropriate when the process cannot begin without it. This is a workflow decision, and the form’s instruction should match the chosen rule.

Configure the field and attachment separately

CF7’s file-upload documentation distinguishes an optional file field from required file*. Set accepted types and maximum size explicitly. For example, an optional PDF brief with a two-megabyte field limit can use:

[file project-brief filetypes:pdf limit:2mb]

In the Mail tab’s File attachments setting, use the corresponding mail-tag:

[project-brief]

The form-tag creates the input; the mail-tag connects the uploaded file to the outgoing attachment. Putting a file’s field name into the message body does not replace that attachment setting. Review the actual field names after copying or renaming a form so that an old tag does not remain in the mail configuration.

CF7’s documented upload process uses temporary storage and removes uploaded files after the mail procedure. Do not treat that temporary directory as a permanent document archive. If your workflow needs long-term retention or another destination, select and verify that separate behavior explicitly.

Check every size boundary

The field limit is only one boundary. PHP documents both upload_max_filesize and post_max_size; the latter governs the whole request, including uploads, and must accommodate more than the individual file limit. See the PHP configuration reference. Ask the person maintaining the site to verify the effective values used by its web runtime.

Then check the selected email service’s attachment and message limits. Several individually acceptable files can create a message that is too large. A receiving organization may also apply its own policy. A higher form limit therefore does not promise that a large attachment will reach every recipient.

Keep a short configuration record with the intended file limit, the server constraint and the mail-service boundary. If a visitor reports that small files work and larger files fail, this record gives the investigation a starting point. Change the smallest relevant setting only after identifying the actual limit; increasing every limit can hide the cause.

Use a test matrix with meaningful boundaries

Create harmless fixtures with recognizable filenames and no customer information. Record their actual sizes, rather than relying on a rounded size displayed by a file manager. The following cases cover different questions and should have separate expected results:

Case Question Evidence to retain
Small valid PDF Does the normal path work? Form result and matching received attachment
No file selected Does optional or required behavior match the instruction? Validation or accepted result
Disallowed type Is the type policy enforced? Visible field feedback
File above the chosen limit Is the size boundary understandable? Rejection feedback and request outcome
Several supported attachments Does the combined message remain within limits? All expected attachments at the recipient
Mobile file selection Can the visitor find and select the document? Usable field and completed controlled test

For a successful test, inspect the received file itself: correct filename, readable content and expected size. A notification with an empty attachment area is not a pass. Record the outcome in a checklist that another team member can reproduce after a form, hosting or mail-service change.

Separate upload, sending and receipt

A field-level error suggests a different investigation from a notification that arrives without the intended file. Begin by recording what the visitor saw and what the receiving mailbox contained. Preserve the timestamp and synthetic test label so that the site maintainer can correlate the attempt with relevant operational evidence.

The WordPress mail-function reference explains that successful processing is not confirmation that the recipient received the email. Apply that distinction to attachment tests too. A CF7 success response is useful technical evidence, but the receiving side must be checked for the complete attachment outcome.

If ordinary notifications also fail, follow our CF7 email troubleshooting guide. If notifications work and only attachments are missing, focus the investigation on field mapping, attachment configuration, file handling and service limits. This keeps a narrow upload issue from becoming an unnecessary change to the whole mail setup.

Make the operational handoff explicit

Tell the receiving team where to put documents that need to remain available and who can access them. An attachment scattered across individual inboxes is difficult to reconcile with an inquiry’s later status. Use an agreed inquiry identifier and destination so that follow-up does not depend on remembering a visitor’s filename.

Keep analytics separate from document contents. A report can count relevant technical outcomes without collecting filenames, file bodies or private messages as tracking parameters. The free Svetlik Analytics plugin documents a submission-trend dashboard; that is not a claim of attachment storage, inspection or delivery verification.

Finish by adding the upload cases to your regular form testing checklist. The useful result is a known, repeatable attachment path with clear failure evidence and a named owner for fixing it.