AWS S3: 504 error with FileUpload
What i am trying to do:
I want to be able to upload larger files to my AWS S3 bucket and I am testing it locally. I can upload smaller files and have changed the max file size limit to be 500MB
What I tried:
I'm currently trying to upload a 400~ MB file to test but it doesn't get uploaded.
I've tried changing the max_upload_time in my livewire.php, AppServiceProvider.php and change the nginx.conf keepalive_tineout
My issue/the error:
I keep getting 504 (Gateway Time-out) after 60 seconds. It does save locally, but when I try to upload it to my S3 bucket, it doesn't work.
Code:
The fileupload:
FileUpload::make('screensaver_source')
->label(('app.upload_screensavervideo'))
->disk('s3')
->directory(fn() => 'customer' . Auth::user()->customer_id . '/videos')
->visibility('public')
->preserveFilenames()
->acceptedFileTypes(['video/mp4', 'video/quicktime', 'video/mov'])
->hidden(fn(callable $get) => $get('type') !== 'video')
->validationMessages([
'required' => ('app.validation_for_file'),
])
->live()
->maxSize(512000),
livewire.php:
'temporary_file_upload' => [
'disk' => 's3',
'rules' => ['required', 'file', 'max:512000'],
'directory' => null,
'middleware' => ['throttle:60,1', 'universal', InitializeTenancyByDomain::class], // Example: 'throttle:5,1' | Default: 'throttle:60,1'
'preview_mimes' => [
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpg', 'jpeg', 'mpga', 'webp', 'wma',
],
'max_upload_time' => 5,
'cleanup' => true,
],


2 Replies