F
Filament14mo ago
Askancy

must be a file of type: image/*.

I don't understand what I'm doing wrong, I get this error when I try to upload an image:
FileUpload::make('logo')
->disk('s3_company')
->image()
->downloadable(),
FileUpload::make('logo')
->disk('s3_company')
->image()
->downloadable(),
protected $fillable = [
'name',
'website',
'logo',
'data_in',
'data_out',
'slug'
];
protected $fillable = [
'name',
'website',
'logo',
'data_in',
'data_out',
'slug'
];
A message appears in the image that the upload has been completed. I created the element without the images and it created the record. I edited it, loaded the same images and it loaded them without any problems.... Any ideas?
No description
7 Replies
Askancy
AskancyOP14mo ago
any idea?
Dennis Koch
Dennis Koch14mo ago
It’s Laravel validation kicking in. Sounds like it’s detecting the wrong mime type.
Askancy
AskancyOP14mo ago
It was a PNG image, if the mime is wrong, why does it upload instead of failing? Also, why does the error occur only in Create and not in Edit? I honestly did not put any validation...
Dennis Koch
Dennis Koch14mo ago
->image() puts validation. Client side uses FilePond and on save it uses Laravels validator. Not sure what is off though
CaptainJoker
CaptainJoker10mo ago
Were you able to get any solution for this? This popped up all of a sudden for me
Askancy
AskancyOP10mo ago
Honestly, no...
Quadral
Quadral9mo ago
anyone got an answer to this? After debugging, the problem occurs when the file name is longer than 150 characters the file path becomes truncated thus causing the image mime type error (as that is the last error it spits out) Not sure if it's laravel/livewire which gets messed up, but would be good if Filament adds a file name limit validation automatically to prevent this error
Want results from more Discord servers?
Add your server