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 ^^
Solution:Jump to 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.8 Replies
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
Hi mate, sorry, what do u mean by ".but how could I open it again?"
I guess what you ask for is
->openable()
https://filamentphp.com/docs/3.x/forms/fields/file-upload#opening-files-in-a-new-tabIn 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
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.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
->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 πYou're welcome