Skip to content

Support configurable file uploads disk - #133

Merged
duncanmcclean merged 11 commits into
2.xfrom
file-uploads-filesystem
Jul 20, 2026
Merged

Support configurable file uploads disk#133
duncanmcclean merged 11 commits into
2.xfrom
file-uploads-filesystem

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented May 27, 2026

Copy link
Copy Markdown
Member

This pull request updates the importer to support the configurable file uploads disk introduced in statamic/cms#14733.

In multi-server environments where a file might be uploaded on one server but processed on another, the CMS now allows configuring a shared filesystem for temporary file uploads. This PR ensures the importer reads uploaded files from the configured disk rather than hardcoding to the local disk.

Changes

Configurable uploads disk

The ImportController now reads the uploads disk and path from the statamic.system config. Files are still moved to the local disk for import processing since SimpleExcelReader and XMLReader require filesystem paths.

Relative path storage

Import files are now stored with relative paths (eg. statamic/imports/posts/import.csv) instead of absolute paths. This makes imports portable and works correctly with Laravel's Storage API.


Related: statamic/cms#14733

@duncanmcclean

Copy link
Copy Markdown
Member Author

Converting to a draft until the core PR is merged.

@duncanmcclean
duncanmcclean marked this pull request as draft May 27, 2026 09:19
Neither method is called anywhere in the codebase.
str_starts_with($path, '/') only matched Unix-style paths, so imports
saved with a Windows absolute path (eg. C:\...) on older versions
wouldn't have been detected as legacy paths correctly.
getLocalFilePath() and deleteFile() branch on whether an import's
stored path is a legacy absolute path or a new relative one, but
that branch wasn't covered by any test.
@duncanmcclean
duncanmcclean marked this pull request as ready for review July 20, 2026 09:39
@duncanmcclean
duncanmcclean merged commit ff4d8c6 into 2.x Jul 20, 2026
16 checks passed
@duncanmcclean
duncanmcclean deleted the file-uploads-filesystem branch July 20, 2026 09:44
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.

1 participant