© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•5mo ago
Akki

SpatieMediaLibraryFileUpload mime

SpatieMediaLibraryFileUpload::make('documents')
->label('Please upload a copy of the documents.')
->multiple()
->collection('docs')
->acceptedFileTypes([
'application/pdf',
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'image/jpeg',
'image/png',
'image/gif',
'image/bmp',
'image/tiff',
])
->storeFiles(false),
]),

This is what i am currently using, but i am facing multiple issues:

1) if user uploads .CSV file by drag n drop, it gives weird message as given below( Check the image where list of extentions are allowed) :

Expects application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/json, text/json, image/jpeg, image/png, image/gif, image/bmp, image/tiff or application/zip

I want that user should not allow to upload .csv file with proper readable message.

2) if file uploaded is giving error, any type of, say invalid mime type or file size exceeding the size provided; user should not allow to submit the form. let me know how to do it.

#laravel11.x
#filament3.x
#livewire3x
#spatie/laravel-medialibrary11.x
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SpatieMediaLibraryFileUpload dynamic MIME types?
FilamentFFilament / ❓┊help
16mo ago
SpatieMediaLibraryFileUpload enableReordering()
FilamentFFilament / ❓┊help
3y ago
SpatieMediaLibraryFileUpload not showing
FilamentFFilament / ❓┊help
3y ago
SpatieMediaLibraryFileUpload inside createOptionForm()
FilamentFFilament / ❓┊help
3y ago