Maximum file size cannot be set for FileUpload
component
#2711
-
Packagefilament/filament Package Versionv2.12.28 Laravel Versionv9.16 Livewire Versionv2.10 PHP VersionPHP 8.1.6 Bug descriptionWhen I try to upload a larger file I get an error in console: For smaller images it works perfectly, but in an ideal world it may be needed for larger images. Steps to reproduce1. Use the public static function form(Form $form): Form
{
// ...
FileUpload::make('image')
->maxSize(102400)
->label('Featured Image')
->image()
} 2. Upload a large file (2 MB or greater) Relevant log outputThere is only one error in console:
`POST http://cms.test/livewire/upload-file?expires=1654702019&signature=df75b5ad101ec6b07d69162b79e3e21647abf5673d8ed49cf96f8b229e4dcdd8 422 (Unprocessable Content)` |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
Does this help you? https://stackoverflow.com/a/2184541 The console error is from Livewire, not Filament. |
Beta Was this translation helpful? Give feedback.
-
I already tried that and didn't work. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, I don't think this is something wrong with Filament, it is likely your server setup or Livewire |
Beta Was this translation helpful? Give feedback.
-
I faced the exact same issue, this are the steps I took to make it work:
'temporary_file_upload' => [
...
'rules' => 'file|max:102400',
], |
Beta Was this translation helpful? Give feedback.
-
I ran into this as well. Turns out it was my local nginx config. My error was Setting
The default is |
Beta Was this translation helpful? Give feedback.
Does this help you? https://stackoverflow.com/a/2184541
The console error is from Livewire, not Filament.