Skip to content

[6.x] Make Files fieldtype temporary upload storage configurable#14733

Open
duncanmcclean wants to merge 1 commit into
6.xfrom
file-uploads-filesystem
Open

[6.x] Make Files fieldtype temporary upload storage configurable#14733
duncanmcclean wants to merge 1 commit into
6.xfrom
file-uploads-filesystem

Conversation

@duncanmcclean
Copy link
Copy Markdown
Member

@duncanmcclean duncanmcclean commented May 27, 2026

This pull request makes the Files fieldtype's temporary upload storage configurable, allowing files to be stored on a shared filesystem for multi-server environments.

Previously, temporary file uploads were hardcoded to use the local disk at statamic/file-uploads. This caused issues in multi-server setups where a file might be uploaded on one server but processed (e.g., queued form emails with attachments) on another.

This PR adds two new config options in config/system.php:

'file_uploads' => [
    'disk' => env('STATAMIC_FILE_UPLOADS_DISK', 'local'),
    'path' => env('STATAMIC_FILE_UPLOADS_PATH', 'statamic/file-uploads'),
],

These can be configured via environment variables to use a shared filesystem like S3:

STATAMIC_FILE_UPLOADS_DISK=s3
STATAMIC_FILE_UPLOADS_PATH=statamic/file-uploads

This PR also adds a test to verify the configured disk is used.


Requested on Twitter: https://x.com/adampatterson/status/2057113369623298060

@adampatterson
Copy link
Copy Markdown
Contributor

Awesome, thanks so much!

This should work nicely with Livewire Forms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants