F
Filament8mo ago
Subham

File type validation

can't we validate the file type like this when i upload the png i want validation error
FileUpload::make('slider_img1') ->label('Slider Image 1') ->acceptedFileTypes(['jpg', 'jpeg', 'png', 'gif']) ->required() ->disk('public') ->directory('slider_images') ->default(null),
1 Reply
awcodes
awcodes8mo ago
Accepted file types has to be an array of mime types, not extension names.
Want results from more Discord servers?
Add your server