Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting

Contact Form 7 File Upload Not Working: Causes and How to Fix It

Contact Form 7 File Upload Not Working: Causes and How to Fix It

Short answer

Contact Form 7 file uploads usually fail because the file tag is missing from the File attachments box on the Mail tab, the file exceeds the size limit, the extension is not allowed, or the server cannot write to its temporary uploads folder. Fix the attachment setting first, then check limits and permissions.

Key takeaways

  • Put the file tag in the File attachments box on the Mail tab.
  • The default file size limit is small, so set a limit option.
  • PHP upload limits must be at least as large as the form limit.
  • List allowed extensions with the filetypes option.
  • Uploaded files are deleted after the email is sent.
  • Use SMTP or cloud links for large attachments.

Why is Contact Form 7 file upload not working?

Uploads usually fail because the file tag is missing from the File attachments box, the file is too large, the type is not allowed, or the temporary upload folder is not writable.

The form can look as if it works perfectly. The visitor sees a success message, but the email arrives with no attachment.

Other cases show an error such as There was an unknown error uploading the file or The uploaded file is too large. Each message points to a different cause.

This guide covers every common cause in order. If the whole form is failing to send, see our guide on fixing Contact Form 7 not sending first.

Which symptom do you have?

Match what you see to the likely cause, because a missing attachment has a different fix from an upload error message.

SymptomLikely causeFix
Email arrives with no attachmentFile tag not in File attachmentsAdd the tag in the Mail tab
The uploaded file is too largelimit option or PHP limitsRaise the limit and PHP settings
You are not allowed to upload files of this typefiletypes optionAdd the extension
Unknown error uploading the fileTemporary folder not writableFix permissions or folder path
Form sends, email never arrivesMail server rejects large attachmentsUse SMTP, keep files small
Only one file uploadsCore plugin has single file fieldsAdd more fields or a plugin

The official guide on file uploading and attachment explains how the feature is meant to work.

Is the file tag missing from the Mail tab?

Yes, this is the most common cause: Contact Form 7 only attaches a file if you place its tag, such as [your-file], in the File attachments box on the Mail tab.

Adding a file field to the form is only half of the setup. Without the attachment setting, the file is uploaded and then thrown away.

To fix it:

  1. Go to Contact > Contact Forms and open your form.
  2. Check the name of your file field on the Form tab, for example [file your-file].
  3. Open the Mail tab.
  4. Scroll to File attachments and enter the tag, for example [your-file].
  5. Save the form and send a test.

If you use Mail (2) for an auto-reply, it has its own attachments box. Our explainer on Contact Form 7 mail settings covers both.

Is the file larger than the allowed limit?

Contact Form 7 has a default size limit of about 1 MB per file, so larger files are rejected unless you add a limit option to the file tag and your server allows that size too.

Set the limit inside the form tag. For example:

[file your-file limit:5mb filetypes:pdf|jpg|png]

The limit can be written in bytes, kilobytes or megabytes. Keep it realistic, because email providers also cap attachment sizes.

Your server has its own limits as well. PHP's upload_max_filesize and post_max_size settings must be at least as large as your form limit. The PHP manual describes upload_max_filesize and related settings.

Our guide on increasing the max upload size in WordPress shows where to change these values.

Is the file type not allowed?

If visitors see You are not allowed to upload files of this type, the extension is missing from the filetypes option in the file tag.

List each extension separated by a vertical bar, such as filetypes:pdf|doc|docx. Without this option, Contact Form 7 allows a default set of common file types.

Some extensions are blocked for security, such as PHP or other script files. Do not try to allow them.

You can also use the HTML accept attribute through browser file pickers to guide visitors. MDN explains the file input type and its accept attribute.

Can the server write to the temporary upload folder?

Contact Form 7 saves uploaded files to a temporary folder inside wp-content/uploads before attaching them, so an unknown upload error usually means that folder is missing or not writable.

The folder is named wpcf7_uploads. Contact Form 7 creates it automatically and deletes files after the email is sent.

Check the following:

  1. The wp-content/uploads folder exists and is writable by the web server.
  2. Your disk quota is not full.
  3. A security plugin is not blocking file writes in uploads.

Normal folder permissions on most hosts are 755. Our guide on setting correct file permissions in WordPress explains safe values.

If PHP itself reports a missing temporary folder, see our page on fixing missing a temporary folder.

Can you change the temporary upload folder?

Yes, you can define the WPCF7_UPLOADS_TMP_DIR constant in wp-config.php to point Contact Form 7 at a different writable folder if the default location does not work on your host.

Add a line like this above the line that says to stop editing:

define( 'WPCF7_UPLOADS_TMP_DIR', '/path/to/writable/folder' );

Use a full server path to a folder the web server can write to. Keep a backup of wp-config.php before editing it.

This is rarely needed. Most upload errors are fixed by correcting permissions on the default folder.

Is the email too large to deliver?

If the form says it sent but no email arrives, the mail server may be rejecting the message because the attachment makes it too big.

Many hosts cap outgoing message size, and some do not send a bounce back to WordPress. The form shows success even though the email was dropped.

Use an SMTP plugin with a proper mail provider. It gives clearer errors and handles attachments more reliably. Our guide on setting up SMTP in WordPress shows how.

For large files, a better approach is to store them in cloud storage and send a link. Email is not designed for big attachments.

Do the files get saved anywhere?

No, Contact Form 7 deletes uploaded files from the temporary folder after sending the email, so the attachment in the email is the only copy.

This is by design, for privacy and to save disk space. If the email fails, the file is lost.

The Flamingo add-on stores submission details, but it does not keep uploaded files. Our guide to seeing Contact Form 7 submissions explains what Flamingo saves.

If you need to keep files, use a form plugin with built-in file storage or an add-on that saves uploads to the media library or cloud storage.

Can you upload more than one file at once?

The core file field accepts one file per field, so to accept several files you either add more file fields or use an add-on that supports multiple uploads.

Each extra field needs its own tag in the File attachments box. Put each tag on its own line.

Add-ons such as Drag and Drop Multiple File Upload add a multi-file field. Follow the add-on's setup, because it may use its own tag format.

Is a plugin conflict or caching causing the problem?

Caching, optimisation and security plugins can break uploads by delaying Contact Form 7 scripts, serving stale pages or blocking file writes, so test with them turned off.

Clear all caches first. Then exclude Contact Form 7 scripts from delay and combine options.

If uploads still fail, test on a staging site with other plugins deactivated. Our guide to fixing a plugin conflict explains the method.

Check for a red configuration error notice in the form editor too. Our page on Contact Form 7 configuration errors explains each warning.

Frequently asked questions

Why does my Contact Form 7 email arrive without the attachment?

The most common reason is that the file field's tag has not been added to the File attachments box on the Mail tab. Without it, Contact Form 7 uploads the file and then discards it. Add the tag, save the form and send a test.

What is the default file size limit in Contact Form 7?

Contact Form 7 uses a default limit of about one megabyte per file. You can raise it with the limit option in the file tag, but your PHP upload settings and your mail provider's message size limit must also allow the larger size.

Where does Contact Form 7 store uploaded files?

Files are stored briefly in a temporary folder inside the uploads directory and then deleted after the email is sent. The plugin does not keep a permanent copy, so the email attachment is the only record of the file.

Can Contact Form 7 accept multiple files in one field?

The core file field accepts one file. You can add several file fields, each with its own tag in the File attachments box, or use an add-on plugin that provides a multiple file upload field.

Is it safe to allow any file type in Contact Form 7?

No. Only allow the extensions you really need, such as PDF or common image formats. Script files can be dangerous, and Contact Form 7 blocks some risky types by default for this reason.

Sources

  1. File Uploading and Attachment Contact Form 7
  2. Core php.ini directives PHP Manual
  3. input type file MDN Web Docs
  4. Contact Form 7 WordPress.org Plugin Directory

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.