HosseinHasanpouri's avatar

Bypass Livewire Temporary Upload

Hello guys I want to find way in livewire to by pass temporary upload for example when i upload image with livewire and s3 i dont want first image move to livewire-tmp on s3 and then i should copy that to another folder with storeAs function i want use storeAs function and bypass livewire temporary upload

0 likes
6 replies
Tray2's avatar

That isn't possible. All upload are stored in a temp file that you need to move. That is the way the webservers work.

HosseinHasanpouri's avatar

thanks for reply how can i set something like event to fire after livewire temporary upload was finished to move file from tmp folder to my own folder ??

olssonm's avatar

Livewire will always store it temporarily in either your local or s3-disk.

To store the file in your own location you do almost as you would if it where in a normal Laravel-controller:

$this->file->storeAs('/', $filename, 'document');

Then, to cleanup temporary files in s3, run:

php artisan livewire:configure-s3-upload-cleanup

For local storage temporary files will be purged after a certain interval (I think 2 days if I remember correctly).

Pablosj's avatar

I' have this problem: The file appears on the temp folder, but then it is not moved to the definitive folder

Please or to participate in this conversation.