Fileupload Maxsize not working?
Today I was testing some file uploads with max file sizes, and of course the server responded with a "413(Payload Too Large)". So I implemented a 12mb max upload size
->maxSize(12288)
. But when I tested it a again it seemed as if the validation didn't even happen, the fileuploader got stuck again and the server returned the same 413 error.
I've also tried to add ->live()
which didnt work. I've tried to updating the max upload size in the livewire config, didn't work either. Furthermore I have the maxuploadsize defined as php.ini is 100m
I have a feeling it might have something to do I'm handling the upload in the ->afterStateUpdated(function (?Model $record) { //code })
. But even then I would just expect it to show a error to the user that the max filesize is X amount.
Is it a bug that the validation is not working or am I missing something?9 Replies
Did you do this? https://filamentphp.com/docs/3.x/forms/fields/file-upload#file-size-validation
Since Filament is powered by Livewire and uses its file upload system, you will want to refer to the default Livewire file upload validation rules in the config/livewire.php file as well
You can publish the config file https://laravel-livewire.com/docs/2.x/installation#publishing-config
And customize the rule https://laravel-livewire.com/docs/2.x/file-uploads#global-validation
Livewire
Installation | Livewire
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Livewire
File Uploads | Livewire
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Do you mean this?
And yes I tried the ->maxSize() as I stated above
413 Payload too large is likely your server configuration I believe, nginx by anychance?
I'm using valet for windows as local developmenttool, I'm not sure which engine that uses.
But .ini settings are as below
Looked it up, Valet uses Nginx yes
Solution
The fact it says payload is the indicator it's server side
Mmmmh, I'll take a look
Thanks
Welcomes