F
Filamentβ€’9mo ago
NeA

Media Library - Download uploaded file again (i.e. pdf)

Ahoy there First of all Kudos to the Project: Awesome! I am experimenting a little with what is possible, views, plugins etc. and created a Resource, installed spatie media-library and the filament plugin. Now, the edit view looks fine, I can upload and remove files, files are stored, images I can directly see. But I also uploaded a pdf. I can see the name, I could remove it, I could upload more... ...but how could I open it again? Do I have a create a new view for it? Do I have to create a specific field? I was looking around and searching a little but did not find this case or am asking the wrong question. Thanks a lot for any hint in the right direction in advance Have a nice Sunday ^^
No description
Solution:
Don't know if I understand you will. But, to allow opening or downloading files, you can use ->openable() and ->downloadable(). They'll display a button for open the file and another for download it.
Jump to solution
8 Replies
NeA
NeAOPβ€’9mo ago
Sunday may not be the best day to ask such questions, so hoping someone will be able to help in no rush of course ^^ Thanks
christmex
christmexβ€’9mo ago
Hi mate, sorry, what do u mean by ".but how could I open it again?"
NeA
NeAOPβ€’9mo ago
In the screenshot, if I click on a file nothing happens. There is no download icon. How would I download it if somebody else uploaded eg a PDF?
Solution
MohamedSabil83
MohamedSabil83β€’9mo ago
Don't know if I understand you will. But, to allow opening or downloading files, you can use ->openable() and ->downloadable(). They'll display a button for open the file and another for download it.
MohamedSabil83
MohamedSabil83β€’9mo ago
Someone create a record which uploaded the two files like shown in your image. But, when display it, there's neither an open button nor download one. You want to display one or both of them. Am I right? Or, you maybe talk about the preview? FYI, the preview is for images only unless the team supported more in the newest versions
NeA
NeAOPβ€’9mo ago
->downloadable() is what I was looking for. I assumed the whole widget would just bring it all at once. Thanks big time for the help πŸ™
MohamedSabil83
MohamedSabil83β€’9mo ago
You're welcome
Want results from more Discord servers?
Add your server