Pdf file upload doesn't save path in database, image does
Uploading an image using above component works as expected (see attachment 1)
Uploading a pdf using above component results in a db error because
file
attribute can not be null (see attachment 2).
Am I having the wrong expectations here or doing something wrong?5 Replies
It looks like there's something wrong with the pdf. Trying a different pdf file works like expected
Looks like it's because of a long file name
how long?
= 244 chars long
It might add some complexity but adding https://filamentphp.com/docs/2.x/spatie-laravel-media-library-plugin/installation and https://spatie.be/docs/laravel-medialibrary/v10/introduction will give you some really handy features. It might also solve your problem.
Filament
Installation - Spatie Media Library Plugin - Filament
A plugin to add support for spatie/laravel-medialibrary to Filament.
Introduction | laravel-medialibrary
laravel-medialibrary