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
'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

0 Replies