How to add properties to a file?
Is it possible to add a custom property to a file using the FileUpload component with Filepond?
Something like storing the uploader's ID or a description field.
5 Replies
Great avatar by the way. Lol.
What have you tried? You can’t attach meta directly to a FileUpload but you could use additional fields to accomplish this. Or you could use something like https://filamentphp.com/plugins/ralphjsmit-media-library-manager. https://filamentphp.com/plugins/filament-spatie-media-library or https://filamentphp.com/plugins/awcodes-curator
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
Thanks lol!
Great suggestions but these seem like overkill as I'd just like to have a couple JSON columns to store extra data like a user id and description
Fair enough. It can be done but you’ll have to do it yourself as it’s not built in to the FileUpload field.
Tempted to just to do it in livewire 🤣 would be cool to have custom properties for files out of the box. Thanks for the prompt replies 👍🏻
Good luck. I think you could do it with standard form fields, but whatever you need.