File Storage in Separate Data Store Area to App

As I plan the hosting of my app, I want to have a separate file store area to the where my code is hosted… I will probably use AWS and use EC2 for hosting the app, and S3 for hosting the files.

The Server Actions seem to only give options to upload files to a data structure within the app hosted environment… is there a way to choose a file store outside of the app root, on a different server?

Best wishes,
Antony.

Hi Antony, not currently possible unless you integrate direct with their API. See the feature request here.

I asked for an update but understand that there are so many providers of block storage that it would be difficult to integrate with them all (AWS, Azure, GCP, Hetzner, Digital Ocean, Vultr… the list goes on!)

Thanks for the update @max_gb!

I’m wondering whether if I do a Database Connection to the file server, upload the file, then do a Database Connection to the app server for the databare write it would work… I’m no guru on file upload, but I’m guessing from the feature request that it won’t!

You could try alternate database connections but the benefit of using the S3 API is that the file uploads via POST from the clients browser so your server doesn’t see the workload. If you have a reasonable amount of users uploading large-ish files at once then you will take a hit.

The other thing to think about is S3 security and permissions as you wouldn’t want the world to see confidential files. This is something else you would need to control through Identity and Access Management.