File Uploads
FilaForms supports file uploads and digital signature capture. Files are stored using Laravel's filesystem with a configurable disk and path.
File Upload Field
The file upload field lets respondents attach files to their submissions. Uploaded files are renamed using ULID-based filenames for uniqueness and stored in an organized directory structure.
Default behavior:
- Single file per field
- Maximum file size: 10 MB
- Preview, download, and open enabled
- Original filenames are not preserved
Storage Configuration
File storage is configured in config/filaforms.php under the storage key.
'storage' => [
'disk' => env('FILA_FORMS_STORAGE_DISK', 'local'),
'path' => 'form-submissions',
],
| Option | Default | Env Variable | Description |
|---|---|---|---|
disk | local | FILA_FORMS_STORAGE_DISK | Laravel filesystem disk to use |
path | form-submissions | -- | Base directory for all uploaded files |
Directory Structure
Files are organized by form ID and field code:
form-submissions/{form-id}/{field-code}/{ulid}.{ext}
This keeps uploads isolated per form and field, making cleanup and access control straightforward.
Validation
The file upload field type supports these validation rules:
| Rule | Description |
|---|---|
file | Ensures the uploaded value is a valid file (enabled by default) |
mimes | Restrict allowed file types with a comma-separated list (e.g., pdf,doc,docx) |
max | Maximum file size in kilobytes |
required | Field must have a file attached |
Signature Field
The signature field provides a canvas pad for capturing handwritten signatures directly in the browser.
| Property | Value |
|---|---|
| Supported output formats | PNG, JPEG, WebP |
| Max capture size | 512 KB |
| Searchable | No |
| Sortable | No |
Signatures are captured as base64 data URIs on the client, then validated, decoded, and stored as image files through the same StorageConfig used by file uploads. The stored path replaces the base64 data in the submission record.
Public vs Private Storage
By default, files use the local disk, which stores files in storage/app/private -- not publicly accessible via URL.
To make uploaded files web-accessible:
Set the Storage Disk
FILA_FORMS_STORAGE_DISK=public
Create the Symbolic Link
php artisan storage:link
Accessing Files
Use Laravel's Storage facade with the configured disk to retrieve file URLs:
use Illuminate\Support\Facades\Storage;
$url = Storage::disk(config('filaforms.storage.disk'))->url($path);
The StorageConfig class provides a convenience method for the same operation:
$url = app(\FilaForms\Core\Support\StorageConfig::class)->url($path);