Collecting Uploader Information on Frontend Upload Forms
Providing secure file upload interfaces for clients, contractors, or team members often requires collecting context about the uploader—such as their name, email address, or comments. Simple File Vault provides a robust, dual-layer configuration system to handle this metadata capture efficiently without coding, along with deep integrations for third-party form builders and automations.
This guide explains how to enable metadata fields globally across your WordPress site, contextually override those settings on specific portal pages using Gutenberg block controls, and leverage automated notifications and third-party integrations.
1. Global Metadata Settings in the WordPress Dashboard
By default, the uploader form remains simple and clean to minimize user friction. To enable metadata collection globally across your entire site:
- Log in to your WordPress dashboard.
- In the sidebar menu, click on Simple File Vault (or Safe File Vault).
- Scroll down to the Global Uploader Metadata Settings section.
- Toggle any or all of the three capture options:
- Capture Uploader Name: Appends a text input field to the upload block for the user’s name.
- Capture Email Address: Appends an email input field with built-in client-side and server-side validation.
- Capture Uploader Comments: Appends a multi-line text area allowing the user to provide notes or instructions.
- Click Save Changes.
Behind the Scenes: Data Architecture
When these settings are updated, the plugin saves these preferences using three core WordPress options:
sfvlt_enable_uploader_namesfvlt_enable_uploader_emailsfvlt_enable_uploader_comments
2. Block-Level Overrides in the Gutenberg Editor
While global defaults are helpful, different portal pages serve different business workflows. For example, a public submission page might hide email requests to protect privacy, whereas a private law firm client onboarding portal might strictly require names and email addresses.
To override global metadata defaults contextually on an individual page:
- Open the target page or post inside the WordPress block editor (Gutenberg).
- Select the Safe File Vault or File Uploader block.
- In the right-hand Block Settings Sidebar, expand the Uploader Metadata Controls panel.
- Toggle the switches to explicitly show or hide specific fields:
- Show Uploader Name Field (
showUploaderName) - Show Uploader Email Field (
showUploaderEmail) - Show Uploader Comments Field (
showUploaderComments)
- Save or Update the page.
The Override Precedence Rule
The rendering engine in simple-file-vault.php checks for block attributes first. If an attribute is explicitly defined in the Gutenberg editor, it overrides the global dashboard configuration:
// Core logic illustrating block precedence:
$enable_name = isset( $attributes['showUploaderName'] ) ? (bool) $attributes['showUploaderName'] : (bool) get_option( 'sfvlt_enable_uploader_name', false );
$enable_email = isset( $attributes['showUploaderEmail'] ) ? (bool) $attributes['showUploaderEmail'] : (bool) get_option( 'sfvlt_enable_uploader_email', false );
$enable_comments = isset( $attributes['showUploaderComments'] ) ? (bool) $attributes['showUploaderComments'] : (bool) get_option( 'sfvlt_enable_uploader_comments', false );
3. Form Builders & Automation Integrations
In addition to the native Gutenberg uploader, Simple File Vault (v1.1.0+) includes built-in integration listeners that automatically map metadata from popular WordPress form plugins and automation engines:
- Gravity Forms: Hooks into
gform_after_submissionto extract client names, emails, and comments from form entries. - Fluent Forms: Hooks into
fluentform/submission_insertedto capture uploader details directly. - Uncanny Automator: Registers custom upload triggers so that file submissions can initiate automated multi-step workflows.
4. REST API Ingestion & Storage
When a user submits files via the frontend upload interface, the frontend script (core-frontend.js / core-frontend.min.js) packages the metadata inputs and sends them as parameters (uploader_name, uploader_email, uploader_comments) to the secure REST route:
POST /wp-json/safe-vault/v1/upload
Upon validation:
- The file is placed securely inside the isolated
/wp-content/uploads/safe-vault/directory. - The metadata is sanitized at the API layer using:
sanitize_text_field()sanitize_email()sanitize_textarea_field()
- The records are saved in the WordPress options table under
sfvlt_file_uploader_metadata, keyed by the relative file path:
{
"user-1/contract-final.pdf": {
"uploader_name": "Alice Vance",
"uploader_email": "alice@example.com",
"uploader_comments": "Signed and executed copy for partner review."
}
}
- The core action hook
sfvlt_after_file_uploadis triggered, passing$file_path,$file_meta_array, and$uploader_datafor automated email notifications, webhooks (Slack, Discord, Teams, Zapier), and custom CRM sync routines.
This dual-layer flexibility makes it simple to capture client details dynamically while ensuring strict backend sanitization, safety, and instant notification delivery.
