Hi Frappe Community,
We are working on a Frappe-based application where the volume of uploaded documents is expected to grow significantly over time.
Currently, Frappe stores uploaded files under:
sites/<site>/public/files/
sites/<site>/private/files/
We would like to move the actual file storage outside the Frappe sites directory while keeping Frappe’s standard File DocType and attachment functionality.
Our requirements are:
-
Store both public and private files outside the
sitesdirectory. -
Use an external location such as:
-
Mounted disk
-
NFS
-
Azure Blob Storage
-
S3-compatible storage
-
MinIO
-
-
Frappe should still be able to:
-
Read files
-
Download files
-
Serve public files
-
Authenticate/authorize private files
-
Manage attachments through the
FileDocType
-
-
Existing functionality using
frappe.get_doc("File"), attachments,file_url, etc. should continue to work. -
Ideally, files should be written directly to the external storage rather than first being saved under
sites/<site>/public/filesorprivate/files.
I came across references to File.is_remote_file and file handling methods such as write_file, but I could not find a clear configuration or officially recommended storage-backend mechanism for this use case.
Is there a supported way in Frappe to configure a custom/external storage backend for all public and private files?
If not, what would be the recommended approach for implementing this?
Would overriding/customizing the file storage implementation be the correct approach, or is using symlinks/mounted storage considered the preferred solution?
Any guidance on the recommended production architecture would be appreciated.
Thanks!