Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mash Square's avatar

Livewire File Uploads + Vapor

Hi,

I'm currently developing locally an app that will need to use Livewire to upload large files to S3. When I will deploy my app with vapor, what happens to the Livewire temp directory used for side-loading? I mean is that temp directory going to be taken care of when I attach the S3 bucket in the vapor.yml file?

I would like to avoid getting a test domain just to add the CORS permission settings on AWS to use an S3 bucket as a temp folder for uploads...I Know about the livewire config file and how to set it up to use S3 for side-loading but it won't work locally...

0 likes
2 replies
martinbean's avatar

@mash square Livewire uses your application’s default disk. You can use local locally and S3 on Vapor. All you need to do is set your FILESYSTEM_DRIVER environment variable appropriately on both environments.

So put…

FILESYSTEM_DRIVER=local

In your .env file locally, and set the following environment variable in Vapor:

FILESYSTEM_DRIVER=s3

Reference: https://laravel-livewire.com/docs/2.x/file-uploads#storing-files

The previous example demonstrates the most basic storage scenario: Moving the temporarily uploaded file to the "photos" directory on the app's default filesystem disk.

Mash Square's avatar

Thank you for the reply! So, correct me if I'm wrong, in this case I would not have to edit the CORS settings of the bucket? I'm trying to reduce the number of surprises I will get during deployment... :)

Please or to participate in this conversation.