Export download prompt
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export
Unless im blind, is there a way to click export, then prompt the ability for the user to download and save to their device, rather than saving in storage? As im assuming this is gonna require a separate link or button to doiwnload the exported file?...
18 Replies
I would prefer this too - my exports are not large enough to justify the backgrounding & db-notification requirements
No, the way the system is designed is for batch exporting not direct. It has performance in mind for bulk exporting.
You could see if Dan would accept a PR for a new method: download() which runs the functions opposed to jobbing it and then downloads it directly.
i.e. ->download(queue) or ->download(direct)
I would love to see this too!
Apologies for the delayed reply. Defo something useful, but would have to be something I'd have to gain time for.
Dan is looking to add a direct() method possibility.
direct?
As in directing what to do with the export?
A direct download type.
Ah, yeah would be great. Just the naming of "direct" threw me off a little 🤣
But yeah, from a client using the cms POV, would be great to allow them to obtain the export
Is there a PR or issue for this that we can follow?
Not at present, I'll look to create one
Thank you!
@toeknee Were you in the progress of doing a PR for the ability to download an export?
I didn't get round to it, so please feel free!
Cool, Ill take a look in my spare time, Just randomly sprung to mind while at work
I was looking for this feature yesterday. So I think it's good to have.
I totally forgot to have a look into it ngl. Ill have to try find some time
agree ^^
So Im almost certain there has to be an easier way, but for now, I made a custom action, and implemented the Export functionality from ExportCsv class.
Inside the class above, I have this function:
And inside the setUp function, then inside $this->action() function, I call
Very unique to my case, so not ideal to use as a PR
It does still populate the exports table, but doesn't run through the queue etc
But I got lost navigating around things and finding where the best part to break it out would be,
So if anyone does go and make a PR for the download feature, lemme know 😄