increase FileUpload Size limit up to 50MB !

What I am trying to do: - i want to increase Filament FileUpload file size to be 50MB but it only allows up to 2MB not matter what i do... What I did: - i have configured my php.ini to allow large files with :
php artisan tinker
> ini_get('upload_max_filesize')
= "50M"

> ini_get('post_max_size')
= "50M"
php artisan tinker
> ini_get('upload_max_filesize')
= "50M"

> ini_get('post_max_size')
= "50M"
- i have edited livewire config with :
'temporary_file_upload' => [
'disk' => null,
'rules' => ['file', 'max:51200'], // <---- this line
'directory' => null,
'middleware' => null,
'preview_mimes' => [
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpg', 'jpeg', 'mpga', 'webp', 'wma',
],
'max_upload_time' => 5,
'cleanup' => true,
],
'temporary_file_upload' => [
'disk' => null,
'rules' => ['file', 'max:51200'], // <---- this line
'directory' => null,
'middleware' => null,
'preview_mimes' => [
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpg', 'jpeg', 'mpga', 'webp', 'wma',
],
'max_upload_time' => 5,
'cleanup' => true,
],
- i have added the fileUpload config in the Resource :
Forms\Components\FileUpload::make('image')
->label(__('filament.Image'))
->image()
->maxSize(51200)
->required(),
Forms\Components\FileUpload::make('image')
->label(__('filament.Image'))
->image()
->maxSize(51200)
->required(),
My issue/the error:
The data.image.b104df8a-ca0f-45c6-8454-cbf7c0127122 failed to upload.
The data.image.b104df8a-ca0f-45c6-8454-cbf7c0127122 failed to upload.
No description
3 Replies
Bruno Pereira
Bruno Pereira4w ago
If I'm not mistaken you also need to increase the file size in the livewire.php config file or filament.php config file, one of those
Mahmoud Elshiha
Mahmoud ElshihaOP4w ago
Yes, you are right but i have already done that , after some searching i found that i have to change .htaccess in the /public folder too
Bruno Pereira
Bruno Pereira4w ago
you shouldn't at least I never did. Try clearing your cache or something, or restarting your php.

Did you find this page helpful?