File Uploads

Overview

Formcierge supports single-file and multi-file uploads. Uploaded files are stored in the WordPress uploads directory (wp-content/uploads/formcierge/) and attached to the entry.

Field Types

  • File Upload (file) — one file per field
  • Multi File Upload (file-multi) — multiple files per field

Field Settings

Setting Default Description
Allowed types image/*, .pdf Comma-separated MIME types or file extensions
Max file size 5 MB Maximum size per individual file
Max files 5 Multi-file only — maximum number of files

Server Limits

File upload limits are also controlled by PHP and your web server:

; php.ini
upload_max_filesize = 10M
post_max_size       = 12M
max_file_uploads    = 20

Formcierge respects these limits and shows a clear error if a file exceeds them.

Accessing Uploaded Files

In the entry detail view, each uploaded file is shown as a download link. Files are also available via the REST API submissions endpoint:

{
  "field_id": "file_cv",
  "value": {
    "url": "https://site.com/wp-content/uploads/formcierge/2025/03/resume.pdf",
    "name": "resume.pdf",
    "size": 204800,
    "mime": "application/pdf"
  }
}

Including Files in Email Notifications

Use the formcierge_email_attachments filter to attach uploaded files to notification emails:

add_filter( 'formcierge_email_attachments', function ( $attachments, $form_id, $entry_id, $data ) {
    foreach ( $data as $value ) {
        if ( is_array( $value ) && isset( $value['path'] ) ) {
            $attachments[] = $value['path'];
        }
    }
    return $attachments;
}, 10, 4 );