Contact forms

Contact Form 7 file attachments not arriving: how to fix it

Fix missing Contact Form 7 attachments: the [file] tag, the File attachments field, PHP upload limits, the wpcf7_uploads folder and mail size limits.

October 20, 2026 · 6 min read

Want it fixed today? Free for 5,000 emails a month. No card.

You added a file upload to your Contact Form 7 form. Visitors attach a CV, a photo or a PDF, the form says the message was sent, and the email arrives with no attachment. Or the email never arrives at all. The upload has to pass several separate limits and settings before it reaches your inbox. This guide goes through them in order.

This guide covers attachments only. If form emails are not arriving at all, start with the full guide: Contact Form 7 not sending email: the complete checklist.

How Contact Form 7 handles an uploaded file

When the visitor submits the form, the file goes to your server. Contact Form 7 checks its type and size, moves it into a temporary folder, attaches it to the email and passes the email to WordPress. At the end of the request it deletes the file. It does not keep a copy, so the email is the only place the file ends up.

1. Check the [file] form-tag

Go to Contact → Contact Forms, edit the form and look at the Form tab. A file field looks like this:

[file* your-file limit:5mb filetypes:pdf|doc|docx|jpg|png]
  • file* makes the upload required. Use file if it is optional.
  • limit: sets the maximum size of the file in bytes. You can add kb or mb, as in limit:500kb. Without it, the limit is 1 MB, which is too small for many photos and scanned PDFs.
  • filetypes: is a pipe-separated list of file extensions or MIME types. Without it, only audio, video and image files are accepted, so PDFs and Word files are rejected.

If a file is too large, the visitor sees “The uploaded file is too large.” under the field. If the type is not allowed, they see “You are not allowed to upload files of this type.” In both cases the form shows “One or more fields have an error” and no email is sent.

2. Put the mail-tag in “File attachments”, not in the body

This is the most common cause. Adding a file field to the form does not attach anything by itself. Open the Mail tab and scroll to the File attachments field at the bottom. Enter the field’s mail-tag there:

File attachments:
[your-file]

If you put [your-file] in the Message body instead, the email only shows the file name. If your form has more than one file field, add each mail-tag. If you use Mail (2) and want the file in that email too, it has its own File attachments field. Save the form after the change.

The mail-tag must match the field name exactly. If the form uses [file* cv-upload], the File attachments field needs [cv-upload]. If you renamed the field after setting up the Mail tab, the old tag no longer matches and nothing is attached.

3. Check PHP and web server upload limits

The limit: option only works if your server accepts files that large. Two PHP settings control this:

  • upload_max_filesize: the largest single file PHP accepts.
  • post_max_size: the largest whole form submission. It must be larger than upload_max_filesize, because the submission includes the other fields too.

To see your values, go to Tools → Site Health → Info and open Media Handling. Look at “Max size of an uploaded file”, “Max size of post data allowed” and “Max effective file size”. Set limit: below the effective size.

If a file is larger than upload_max_filesize, Contact Form 7 shows “There was an error uploading the file.” If the whole submission is larger than post_max_size, PHP throws away all the form data, and the result can look like an empty or broken submission. Your web server can also have its own request size limit, such as client_max_body_size on Nginx. Raise these in your hosting control panel’s PHP settings, or ask your host.

4. Check the temporary upload folder

Contact Form 7 stores uploads in wp-content/uploads/wpcf7_uploads until the email is sent. The folder must exist and be writable by the web server. If it is not, Contact Form 7 shows a warning when you edit the form, and visitors see “There was an unknown error uploading the file.”

  1. Open the form in the editor and look for a warning about the temporary folder.
  2. Using your host’s file manager or SFTP, check that the folder exists. Create it if it does not.
  3. Make sure it is owned by the same user as the rest of wp-content/uploads and has the same permissions, usually 755. Avoid 777.

To use a different folder, define WPCF7_UPLOADS_TMP_DIR in wp-config.php. The path is relative to wp-content and must stay inside it. Contact Form 7 adds an .htaccess file to block direct access to the folder on Apache servers.

5. Check message size limits on the mail side

A file that uploads fine can still be too large to email. Attachments are encoded as text (base64) before sending, which makes them about a third larger. A 15 MB file becomes an email of roughly 20 MB.

  • Current versions of Contact Form 7 stop adding attachments once the files for one email pass 25 MB in total. The email is still sent, without the extra files.
  • Your SMTP service or host has a maximum message size. Mail over it is rejected, often with a 552 code. See SMTP bounce codes explained.
  • The recipient’s mailbox has its own limit, which may be lower than your sending limit.

If small files arrive and large ones do not, size is the cause. If the form shows an error only with large files, read “There was an error trying to send your message” as well.

6. Send large files as a link instead

Email is a poor way to move large files. For anything over a few megabytes, ask visitors to upload the file to a cloud storage service and paste the share link into a [url] field. The email stays small, and you can still open the file.

7. Check security tools and blocked file types

Attachments can be removed or blocked at several points:

  • A web application firewall or security plugin on your site can block upload requests, especially for archives or unusual file types.
  • Mail servers and mailbox providers block executable files and some archive types, and can strip or quarantine them.
  • Company mail systems often scan attachments and hold or remove anything they do not trust.

Keep filetypes: to the documents and images you actually need. If uploads fail only on your site, check the firewall or security plugin log for blocked requests at the time of the test. A form that accepts files is also a target for bots, so add the protection described in how to stop spam in Contact Form 7.

Do not accept every file type to make uploads “just work”. Executable files and archives are a common way to spread malware, and mail providers often reject emails that carry them.

Test it properly

  1. Submit the form with a small allowed file, such as a 100 KB PDF.
  2. Confirm the email arrives with the file attached and that the file opens.
  3. Submit again with a file just under your limit: value.
  4. Submit a file over the limit and a file of a disallowed type, and check that the right error appears.

If no email arrives even without a file, the problem is not the attachment. Check that WordPress can send email at all first.

If the small file arrives but the large one does not, check steps 3 and 5. Sending through an authenticated service such as SecureSMTP for Contact Form 7 gives you a delivery log that shows whether each email was delivered or bounced, so you can see where a large message stopped.

Frequently asked questions

Why does the email show the file name but no attachment?

The file’s mail-tag is in the Message body instead of the File attachments field. In the body, the tag is replaced with the file name only. Put the tag, for example [your-file], in the File attachments field at the bottom of the Mail tab.

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

1 MB per file field. Raise it with the limit: option, for example [file your-file limit:5mb]. Your server’s PHP limits must also allow the larger size.

Does Contact Form 7 keep a copy of uploaded files?

No. It saves the file in a temporary folder, attaches it to the email and deletes it at the end of the request. If the email is lost, the file is lost too.

How large can an attachment be?

It is limited by the smallest of several limits: the limit: option, PHP’s upload_max_filesize and post_max_size, your web server, and the message size your mail service and the recipient accept. Current versions of Contact Form 7 also stop attaching files once the total for one email passes 25 MB.

Which file types does Contact Form 7 accept by default?

Audio, video and image files. To accept documents, list them with the filetypes: option, for example filetypes:pdf|doc|docx.

Related reading

Get your contact form emails delivered

SecureSMTP sends your form notifications through an authenticated mail service with SPF, DKIM and DMARC in place, and shows the result of every email in a delivery log.

or sign up with email

Free plan: 5,000 emails a month. No card needed. Set up takes about five minutes.