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?
Solution:
The fact it says payload is the indicator it's server side
Jump to solution
9 Replies
LeandroFerreira
LeandroFerreira14mo ago
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.
biebthesecond
biebthesecondOP14mo ago
Do you mean this?
No description
biebthesecond
biebthesecondOP14mo ago
And yes I tried the ->maxSize() as I stated above
toeknee
toeknee14mo ago
413 Payload too large is likely your server configuration I believe, nginx by anychance?
biebthesecond
biebthesecondOP14mo ago
I'm using valet for windows as local developmenttool, I'm not sure which engine that uses. But .ini settings are as below
upload_max_filesize = 100M
post_max_size = 100M
upload_max_filesize = 100M
post_max_size = 100M
Looked it up, Valet uses Nginx yes
Solution
toeknee
toeknee14mo ago
The fact it says payload is the indicator it's server side
biebthesecond
biebthesecondOP14mo ago
Mmmmh, I'll take a look Thanks
toeknee
toeknee14mo ago
Welcomes
Want results from more Discord servers?
Add your server