F
Filament6mo ago
bwubs

FileUpload validation message

I have a file upload that works, but when a file is uploaded that is too big, I get a validation error (as expected) but I'm unable to change the content of the message. It now shows the full path to the FileUpload field in the form, but I just want it to show the label of the input field. I've tried it with overwriting the ->validationMessages(['max' => ...]) or with ->validationAttribute(__('Document')). But none works. The Livewire temporary file upload gives this error, but I'm unable to change the error message inside of filament. Am I missing something?
No description
5 Replies
Tetracyclic
Tetracyclic6mo ago
Is the file size limit on the server set lower than the max being set on the component itself? In my tests I only ever see the error from FilePond, before it gets sent to the server
Tetracyclic
Tetracyclic6mo ago
No description
Tetracyclic
Tetracyclic6mo ago
I only see that error message if Livewire's upload limit is lower than what it set on the component itself
Tetracyclic
Tetracyclic6mo ago
No description
Tetracyclic
Tetracyclic6mo ago
If that's the case, you can set ->maxSize() on the FileUpload component to the maximum size in bytes allowed by the server, and the user won't see that error message
Want results from more Discord servers?
Add your server